MCPcopy Create free account
hub / github.com/DOSNetwork/core / MarshalSize

Method MarshalSize

group/mod/int.go:308–310  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

306// and not on the the value of the encoded integer,
307// making the encoding is fixed-length for simplicity and security.
308func (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.

Callers 9

MarshalBinaryMethod · 0.95
UnmarshalBinaryMethod · 0.95
BigEndianMethod · 0.95
LittleEndianMethod · 0.95
HideLenMethod · 0.95
TestIntEndianBytesFunction · 0.45
PointUnmarshalFromFunction · 0.45
ScalarUnmarshalFromFunction · 0.45
VerifyFunction · 0.45

Calls

no outgoing calls

Tested by 1

TestIntEndianBytesFunction · 0.36