Additional bytevector utilities.
Retrieve a 16-bit unsigned integer value from the given bytevectorbv
at offset i
, in little-endian order.Retrieve a 16-bit unsigned integer value from the given bytevector
bv
at offset i
, in big-endian order.Retrieve a 32-bit unsigned integer value from the given bytevector
bv
at offset i
, in little-endian order.Retrieve a 32-bit unsigned integer value from the given bytevector
bv
at offset i
, in big-endian order.
Convert an unsigned integer n
to a bytevector representing
the base-256 big-endian form (the zero index holds the MSB).The inverse of integer->bytevector
. Convert a bytevector
representing the base-256 big-endian form (the zero index holds
the MSB) to the corresponding unsigned integer.Utility to pad a bytevector with zeros. Padding is added to the
left so as not to change the big-endian value.
Big-endian conversion, guaranteed padded to even length.