mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-04 01:54:28 +00:00
14 lines
209 B
Go
14 lines
209 B
Go
|
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
|
||
|
}
|