func FromInt64(value int64) ID {
	return FromInt(big.NewInt(value))
}
FromInt64 creates an ID from an int64.
package id
import (
	"bytes"
	"crypto/ecdsa"
	crand "crypto/rand"
	"encoding/hex"
	"fmt"
	"math/big"
	mrand "math/rand"
	"github.com/drausin/libri/libri/common/errors"
)
const (
	Length = 32
)
var (
	UpperBound = FromBytes(bytes.Repeat([]byte{255}, Length))
	LowerBound = FromInt(big.NewInt(0))
)
type ID interface {
	fmt.Stringer
	Bytes() []byte
	Int() *big.Int
	Cmp(ID) int
	Distance(ID) *big.Int
}
type id struct {
	intVal *big.Int
}
func (x *id) Int() *big.Int {
	return x.intVal
}
func (x *id) Bytes() []byte {
	b := x.Int().Bytes()
	if len(b) < Length {
		lpad := make([]byte, Length-len(b))
		return append(lpad, b...)
	}
	return b
}
func (x *id) String() string {
	return Hex(x.Bytes())
}
func (x *id) Cmp(other ID) int {
	return x.Int().Cmp(other.Int())
}
func (x *id) Distance(y ID) *big.Int {
	return new(big.Int).Xor(x.Int(), y.Int())
}
func FromInt(value *big.Int) ID {
	return &id{intVal: value}
}