Wafer.Format (wafer v1.0.2)
Handy functions for formatting bytes, especially for debugging.
Link to this section Summary
Functions
Convert the provided value into it's 0-padded byte-oriented string representation.
Convert the provided value into it's 0-padded byte-oriented string representation.
Link to this section Functions
Link to this function
to_bin(value)
Specs
Convert the provided value into it's 0-padded byte-oriented string representation.
examples
Examples
iex> to_bin(0x1234)
"0b00010010_00110100"
iex> to_bin(<<0xF0, 0x0F>>)
"0b11110000_00001111"
Link to this function
to_hex(value)
Specs
Convert the provided value into it's 0-padded byte-oriented string representation.
examples
Examples
iex> to_hex(0x1234)
"0x1234"
iex> to_hex(<<0xF0, 0x0F>>)
"0xF00F"