MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / PaddedBigBytes

Function PaddedBigBytes

utils/big.go:138–145  ·  view source on GitHub ↗

PaddedBigBytes encodes a big integer as a big-endian byte slice. The length of the slice is at least n bytes.

(bigint *big.Int, n int)

Source from the content-addressed store, hash-verified

136// PaddedBigBytes encodes a big integer as a big-endian byte slice. The length
137// of the slice is at least n bytes.
138func PaddedBigBytes(bigint *big.Int, n int) []byte {
139 if bigint.BitLen()/8 >= n {
140 return bigint.Bytes()
141 }
142 ret := make([]byte, n)
143 ReadBits(bigint, ret)
144 return ret
145}
146
147// bigEndianByteAt returns the byte at position n,
148// in Big-Endian encoding

Callers 7

SignMethod · 0.92
VerifyMethod · 0.92
TestPaddedBigBytesFunction · 0.85
BenchmarkByteAtOldFunction · 0.85

Calls 2

ReadBitsFunction · 0.85
BytesMethod · 0.45