Word16 package:bytebuild

Note: This results in a zigzag encoded number. Avro does not have unsigned types.
Requires exactly 2 bytes. Dump the octets of a 16-bit word in a big-endian fashion.
Encodes an unsigned 16-bit integer as decimal. This encoding never starts with a zero unless the argument was zero.
Requires exactly 2 bytes. Dump the octets of a 16-bit word in a little-endian fashion.
Encode a 16-bit word with LEB-128.
Encode a 16-bit unsigned integer as hexadecimal without leading zeroes. This uses lowercase for the alphabetical digits. For example, this encodes the number 1022 as 3fe.
Encode a 16-bit unsigned integer as hexadecimal, zero-padding the encoding to 4 digits. This uses lowercase for the alphabetical digits. For example, this encodes the number 1022 as 03fe.
Encode a 16-bit unsigned integer as hexadecimal, zero-padding the encoding to 4 digits. This uses uppercase for the alphabetical digits. For example, this encodes the number 1022 as 03FE.
Encode a 16-bit unsigned integer as hexadecimal without leading zeroes. This uses uppercase for the alphabetical digits. For example, this encodes the number 1022 as 3FE.
Requires exactly 2 bytes. Dump the octets of a 16-bit word in a big-endian fashion.
Requires up to 5 bytes. Encodes an unsigned 16-bit integer as decimal. This encoding never starts with a zero unless the argument was zero.
Requires exactly 2 bytes. Dump the octets of a 16-bit word in a little-endian fashion.
Encode a 32-bit word with LEB-128.
Requires at most 4 bytes. Encodes a 16-bit unsigned integer as hexadecimal. No leading zeroes are displayed. Letters are presented in lowercase. If the number is zero, a single zero digit is used.
>>> word16LowerHex 0xab0
ab0
Requires exactly 4 bytes. Encodes a 16-bit unsigned integer as hexadecimal, zero-padding the encoding to 4 digits. This uses lowercase for the alphabetical digits.
>>> word16PaddedLowerHex 0xab0
0ab0
Requires exactly 4 bytes. Encodes a 16-bit unsigned integer as hexadecimal, zero-padding the encoding to 4 digits. This uses uppercase for the alphabetical digits.
>>> word16PaddedUpperHex 0xab0
0AB0
Requires at most 4 bytes. Encodes a 16-bit unsigned integer as hexadecimal. No leading zeroes are displayed. Letters are presented in uppercase. If the number is zero, a single zero digit is used.
>>> word16UpperHex 0xab0
AB0