Skip to main content

encode_big_int_caster

Function encode_big_int_caster 

Source
pub fn encode_big_int_caster(value: &BigInt) -> Bytes
Expand description

Encodes a BigInt using Go’s BigIntCaster format.

The wire format is sign-byte-plus-magnitude:

  • nil is represented separately by callers as [0]
  • zero is encoded as [0, 0]
  • positive values are encoded as [0, ..magnitude_be]
  • negative values are encoded as [1, ..magnitude_be]