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)
| 166 | // n==0 returns the MSB |
| 167 | // Example: bigint '5', padlength 32, n=31 => 5. |
| 168 | func 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. |