Xgit v0.2.5 Xgit.Util.NB View Source
Conversion utilities for network byte order handling.
Link to this section Summary
Functions
Parses a sequence of 4 bytes (network byte order) as a signed integer.
Parses a sequence of 2 bytes (network byte order) as an unsigned integer.
Parses a sequence of 4 bytes (network byte order) as an unsigned integer.
Convert a 16-bit integer to a sequence of two bytes in network byte order.
Convert a 32-bit integer to a sequence of four bytes in network byte order.
Convert a 16-bit unsigned integer to a sequence of two bytes in network byte order.
Convert a 32-bit unsigned integer to a sequence of four bytes in network byte order.
Link to this section Functions
Parses a sequence of 4 bytes (network byte order) as a signed integer.
Reads the first four bytes from intbuf
and returns {value, buf}
where value is the integer value from the first four bytes at intbuf
and buf
is the remainder of the byte array after those bytes.
Parses a sequence of 2 bytes (network byte order) as an unsigned integer.
Reads the first four bytes from intbuf
and returns {value, buf}
where value is the unsigned integer value from the first two bytes at intbuf
and buf
is the remainder of the byte array after those bytes.
Parses a sequence of 4 bytes (network byte order) as an unsigned integer.
Reads the first four bytes from intbuf
and returns {value, buf}
where value is the unsigned integer value from the first four bytes at intbuf
and buf
is the remainder of the byte array after those bytes.
Convert a 16-bit integer to a sequence of two bytes in network byte order.
Convert a 32-bit integer to a sequence of four bytes in network byte order.
encode_uint16(v)
View Sourceencode_uint16(v :: non_neg_integer()) :: [byte()]
Convert a 16-bit unsigned integer to a sequence of two bytes in network byte order.
encode_uint32(v)
View Sourceencode_uint32(v :: non_neg_integer()) :: [byte()]
Convert a 32-bit unsigned integer to a sequence of four bytes in network byte order.