View Source Hologram.Commons.BitstringUtils (hologram v0.2.0)

Summary

Functions

Converts a list of bits into a corresponding bitstring.

Given a bitstring returns its corresponding list of bits (starting with the most significant bit at index 0).

Functions

from_bit_list(list)

@spec from_bit_list([1 | 0]) :: bitstring()

Converts a list of bits into a corresponding bitstring.

to_bit_list(bitstring)

@spec to_bit_list(bitstring()) :: [integer()]

Given a bitstring returns its corresponding list of bits (starting with the most significant bit at index 0).

Examples

iex> to_bit_list(<<25>>)
[1, 1, 0, 0, 1]