MCPcopy Create free account
hub / github.com/CovenantSQL/CovenantSQL / Byte

Function Byte

utils/big.go:168–173  ·  view source on GitHub ↗

Byte returns the byte at position n, with the supplied padlength in Little-Endian encoding. n==0 returns the MSB Example: bigint '5', padlength 32, n=31 => 5.

(bigint *big.Int, padlength, n int)

Source from the content-addressed store, hash-verified

166// n==0 returns the MSB
167// Example: bigint '5', padlength 32, n=31 => 5.
168func Byte(bigint *big.Int, padlength, n int) byte {
169 if n >= padlength {
170 return byte(0)
171 }
172 return bigEndianByteAt(bigint, padlength-1-n)
173}
174
175// ReadBits encodes the absolute value of bigint as big-endian bytes. Callers must ensure
176// that buf has enough space. If buf is too short the result will be incomplete.

Callers 1

TestLittleEndianByteAtFunction · 0.85

Calls 1

bigEndianByteAtFunction · 0.85

Tested by 1

TestLittleEndianByteAtFunction · 0.68