minimal_twos_complement

Function minimal_twos_complement 

Source
fn minimal_twos_complement(be: &[u8]) -> &[u8] 
Expand description

Minimal two’s-complement big-endian representation helper for Avro decimal (bytes).

For positive numbers, trim leading 0x00 until an essential byte is reached. For negative numbers, trim leading 0xFF until an essential byte is reached. The resulting slice still encodes the same signed value.

See Avro spec: decimal over bytes uses two’s-complement big-endian representation of the unscaled integer value. 1.11.1 specification.