hopp/codec/measure.go

12 lines
194 B
Go

package codec
// GBEUSize returns the size (in octets) of a GBEU integer.
func GBEUSize(value uint64) int {
length := 0
for {
value >>= 7
length ++
if value == 0 { return length }
}
}