erigon-pulse/cmd/lightclient/utils/bytes.go

14 lines
209 B
Go
Raw Normal View History

package utils
import "encoding/binary"
func Uint32ToBytes4(n uint32) (ret [4]byte) {
binary.BigEndian.PutUint32(ret[:], n)
return
}
func BytesToBytes4(b []byte) (ret [4]byte) {
copy(ret[:], b)
return
}