MarshalSize returns the length in bytes of encoded integers with modulus M. The length of encoded Ints depends only on the size of the modulus, and not on the the value of the encoded integer, making the encoding is fixed-length for simplicity and security.
()
| 306 | // and not on the the value of the encoded integer, |
| 307 | // making the encoding is fixed-length for simplicity and security. |
| 308 | func (i *Int) MarshalSize() int { |
| 309 | return (i.M.BitLen() + 7) / 8 |
| 310 | } |
| 311 | |
| 312 | // MarshalBinary encodes the value of this Int into a byte-slice exactly Len() bytes long. |
| 313 | // It uses i's ByteOrder to determine which byte order to output. |
no outgoing calls