Add common/Leaf struct & parsers (bigint & byte arrays)

This commit is contained in:
arnaucube
2020-08-03 12:53:36 +02:00
parent 2f93848292
commit 59644c3435
6 changed files with 433 additions and 1 deletions

10
common/utils.go Normal file
View 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
}