mirror of
https://github.com/arnaucube/arbo.git
synced 2026-01-09 07:21:28 +01:00
Update public methods signatures
- Update public methods signatures - Remove 'lastAccess' param - Add option to pass root for tree.Dump, Iterate, IterateWithStop, Graphviz (and related) - Move error messages to const defined error messages for external usage
This commit is contained in:
5
utils.go
5
utils.go
@@ -12,8 +12,9 @@ func SwapEndianness(b []byte) []byte {
|
||||
}
|
||||
|
||||
// BigIntToBytes converts a *big.Int into a byte array in Little-Endian
|
||||
func BigIntToBytes(bi *big.Int) []byte {
|
||||
var b [32]byte // TODO make the length depending on the tree.hashFunction.Len()
|
||||
func BigIntToBytes(blen int, bi *big.Int) []byte {
|
||||
// var b [blen]byte // TODO make the length depending on the tree.hashFunction.Len()
|
||||
b := make([]byte, blen)
|
||||
copy(b[:], SwapEndianness(bi.Bytes()))
|
||||
return b[:]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user