You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lal/bele/bele.go

16 lines
250 B
Go

package bele
// assume local is `le`
func BeUInt24(p []byte) (ret uint32) {
ret = 0
ret |= uint32(p[0]) << 16
ret |= uint32(p[1]) << 8
ret |= uint32(p[2])
return
}
func BeUInt16(p []byte) uint16 {
return (uint16(p[0]) << 8) | uint16(p[1])
}