Struct libhumancode::encoder::ChunkEncoder [−][src]
pub struct ChunkEncoder { /* fields omitted */ }
Expand description
A ChunkEncoder
is able to encode up to 150 bits of data with a configurable
number of error correcting symbols.
Implementations
Encode a chunk of input data
data
must be at least 1 byte long, but no longer than 19 bytes.
bits
indicates the number of bits to encode from data
. data
must
have a minimal length given the number of bits
. For example, if bits
is 5, data
must be 1 byte long. If bits
is 9, data
must be 2 bytes long.
bits
must be at least 1 and less than or equal to 150.
data
is encoded in a big-endian fashion. So, if bits
is 1 - only the
highest bit of data
will be encoded. All remaining bits of data
must
be 0s or an error will be reported.