ankh v0.3.1 Ankh.Frame.Utils

Utility functions for encoding/decoding values

Summary

Functions

Converts a boolean into the corresponding 0/1 integer values

Converts 0/1 integers into the corresponding boolean values

Generates an 0 padding binary of the specified size

Functions

bool_to_int!(bool)
bool_to_int!(boolean) :: 0 | 1

Converts a boolean into the corresponding 0/1 integer values

Raises on wrong arguments

int_to_bool!(int)
int_to_bool!(0 | 1) :: boolean

Converts 0/1 integers into the corresponding boolean values

Raises on wrong arguments

padding(size)
padding(Integer.t) :: binary

Generates an 0 padding binary of the specified size