Methods
# to_byte_array() → {Uint8Array}
Convert this value into a byte array.
This is only valid for secret blob values.
if the value is not a secret blob.
Error
the byte array contained in this value.
Uint8Array
Example
const value = NadaValue.new_secret_blob([1,0,1,222,21]);
const byteArray = value.to_byte_array();
# to_integer() → {string}
Convert this value into a string representation of the underlying numeric value.
This only works for numeric secret values, such as integers and unsigned integers.
a string representation of the underlying numeric value
string
Example
const value = NadaValue.new_public_integer("23");
const integer_value = value.to_integer();
# static new_public_integer(value) → {NadaValue}
Create a new public integer with the provided value.
Parameters:
Name | Type | Description |
---|---|---|
value |
string
|
The value must be a valid string representation of an integer. |
The encoded public variable corresponding to the value provided
Example
const value = NadaValue.new_public_integer("-23");
# static new_public_unsigned_integer(value) → {NadaValue}
Create a new public unsigned integer with the provided value.
Parameters:
Name | Type | Description |
---|---|---|
value |
string
|
The value must be a valid string representation of an unsigned integer. |
The encoded public variable corresponding to the value provided
Example
const value = NadaValue.new_public_unsigned_integer("23");
# static new_secret_blob(value) → {NadaValue}
Create a new secret blob.
Parameters:
Name | Type | Description |
---|---|---|
value |
Uint8Array
|
The blob in binary (byte array) encoded format |
The encoded secret corresponding to the value provided
Example
const value = NadaValue.new_secret_blob([1,0,1,222,21]);
# static new_secret_integer(value) → {NadaValue}
Create a new secret integer value.
Parameters:
Name | Type | Description |
---|---|---|
value |
string
|
The value must be a valid string representation of an integer. |
The encoded secret corresponding to the value provided
Example
const value = NadaValue.new_secret_integer("-23");
# static new_secret_unsigned_integer(value) → {NadaValue}
Create a new secret unsigned integer value.
Parameters:
Name | Type | Description |
---|---|---|
value |
string
|
The value must be a valid string representation of an unsigned integer. |
The encoded secret corresponding to the value provided
Example
const value = NadaValue.new_secret_unsigned_integer("23");