aiken_flat/bits

Types

Alias

Bit = Bool

Alias

Bits = List<Bit>

Functions

bit_and(left: Bit, right: Bit) -> Bit

bit_or(left: Bit, right: Bit) -> Bit

bit_to_string(bit: Bit) -> String

pretty_print(bits: Bits) -> String

op_with_truncation(left: Bits, right: Bits, op: fn(Bit, Bit) -> Bit) -> Bits

and_with_padding(left: Bits, right: Bits) -> Bits

and_with_truncation(left: Bits, right: Bits) -> Bits

or_with_padding(left: Bits, right: Bits) -> Bits

or_with_truncation(left: Bits, right: Bits) -> Bits

pad_to_byte(bits: Bits) -> Bits

to_bytearray(bits: Bits) -> ByteArray

from_bytearray(bytes: ByteArray) -> Bits

tag_to_bits(constr_count: Int, tag: Int) -> Bits

Helper function for finding Flat Bits of a generic sum type’s data constructor. This leverages the Data type from UPLC for extracting the Constr tag.

Not enforced, but only constr_count values greater than or equal to 1 make sense, with tag being less than or equal to constr_count - 1. constr_counts less than or equal to 1 yield an empty list, while a negative tag leads to infinite recursion.

bits_to_tag(constr_count: Int, bits: Bits) -> Int

Search Document