mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 11:26:44 +01:00
Add common/Leaf struct & parsers (bigint & byte arrays)
This commit is contained in:
10
common/utils.go
Normal file
10
common/utils.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package common
|
||||
|
||||
// SwapEndianness swaps the order of the bytes in the slice.
|
||||
func SwapEndianness(b []byte) []byte {
|
||||
o := make([]byte, len(b))
|
||||
for i := range b {
|
||||
o[len(b)-1-i] = b[i]
|
||||
}
|
||||
return o
|
||||
}
|
||||
Reference in New Issue
Block a user