MCPcopy Create free account
hub / github.com/ZeppelinMC/Zeppelin / twosComplement

Function twosComplement

protocol/net/authentication.go:82–92  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

80}
81
82func twosComplement(p []byte) []byte {
83 carry := true
84 for i := len(p) - 1; i >= 0; i-- {
85 p[i] = byte(^p[i])
86 if carry {
87 carry = p[i] == 0xff
88 p[i]++
89 }
90 }
91 return p
92}

Callers 1

sessionHashMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected