Boolean
Overview
Boolean element class for performing logical operations in Aleo. This class provides methods for creating boolean values, converting between different formats, and performing logical operations like AND, OR, XOR, NAND, NOR, and NOT.
Constructors
Boolean
Creates a Boolean from a native JS bool
Boolean(value)
| Param | Type |
|---|---|
| value | boolean |
Methods
fromString
Creates a boolean object from a string representation ("true"/"false")
fromString(boolean) ► Boolean
| Param | Type |
|---|---|
| boolean | string |
| return | Boolean |
toString
Returns the string representation of the boolean element
toString() ► string
| Param | Type |
|---|---|
| return | string |
fromBytesLe
Create a boolean element from a Uint8Array of left endian bytes
fromBytesLe(bytes) ► Boolean
| Param | Type |
|---|---|
| bytes | Uint8Array |
| return | Boolean |
toBytesLe
Encode the boolean element as a Uint8Array of left endian bytes
toBytesLe() ► Uint8Array
| Param | Type |
|---|---|
| return | Uint8Array |
fromBitsLe
Reconstruct a boolean element from a boolean array representation
fromBitsLe(bits) ► Boolean
| Param | Type |
|---|---|
| bits | Array.<any> |
| return | Boolean |
toBitsLe
Get the left endian boolean array representation of the boolean element
toBitsLe() ► Array.<any>
| Param | Type |
|---|---|
| return | Array.<any> |
toPlaintext
Create a plaintext from the boolean element
toPlaintext() ► Plaintext
| Param | Type |
|---|---|
| return | Plaintext |
clone
Clone the boolean element
clone() ► Boolean
| Param | Type |
|---|---|
| return | Boolean |
random
Generate a random boolean element
random() ► Boolean
| Param | Type |
|---|---|
| return | Boolean |
not
Logical NOT
not() ► Boolean
| Param | Type |
|---|---|
| return | Boolean |
and
Logical AND
and(other) ► Boolean
| Param | Type |
|---|---|
| other | Boolean |
| return | Boolean |
or
Logical OR
or(other) ► Boolean
| Param | Type |
|---|---|
| other | Boolean |
| return | Boolean |
xor
Logical XOR
xor(other) ► Boolean
| Param | Type |
|---|---|
| other | Boolean |
| return | Boolean |
nand
Logical NAND
nand(other) ► Boolean
| Param | Type |
|---|---|
| other | Boolean |
| return | Boolean |
nor
Logical NOR
nor(other) ► Boolean
| Param | Type |
|---|---|
| other | Boolean |
| return | Boolean |
equals
Check if one boolean element equals another
equals(other) ► boolean
| Param | Type |
|---|---|
| other | Boolean |
| return | boolean |