erigon-pulse/cl/persistence/base_encoding/primitives.go
Giulio rebuffo a2433455f9
Keep few beacon block headers in mdbx (#8809)
Now keep few beacon block headers in mdbx
2023-11-22 01:45:15 +01:00

18 lines
311 B
Go

package base_encoding
import (
"encoding/binary"
)
func Encode64ToBytes4(x uint64) (out []byte) {
// little endian
out = make([]byte, 4)
binary.BigEndian.PutUint32(out, uint32(x))
return
}
func Decode64FromBytes4(buf []byte) (x uint64) {
// little endian
return uint64(binary.BigEndian.Uint32(buf))
}