mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 17:44:29 +00:00
98ceb7cc9c
Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
21 lines
298 B
Go
21 lines
298 B
Go
package utils
|
|
|
|
import (
|
|
"encoding/binary"
|
|
"encoding/hex"
|
|
)
|
|
|
|
func Uint32ToBytes4(n uint32) (ret [4]byte) {
|
|
binary.BigEndian.PutUint32(ret[:], n)
|
|
return
|
|
}
|
|
|
|
func BytesToBytes4(b []byte) (ret [4]byte) {
|
|
copy(ret[:], b)
|
|
return
|
|
}
|
|
|
|
func BytesToHex(b []byte) string {
|
|
return hex.EncodeToString(b)
|
|
}
|