MCPcopy
hub / github.com/lonng/nano / bytesToInt

Function bytesToInt

internal/codec/codec.go:130–136  ·  view source on GitHub ↗

Decode packet data length byte to int(Big end)

(b []byte)

Source from the content-addressed store, hash-verified

128
129// Decode packet data length byte to int(Big end)
130func bytesToInt(b []byte) int {
131 result := 0
132 for _, v := range b {
133 result = result<<8 + int(v)
134 }
135 return result
136}
137
138// Encode packet data length to bytes(Big end)
139func intToBytes(n int) []byte {

Callers 1

forwardMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…