@nimiq/core / Entropy
Class: Entropy
Defined in: @nimiq/core/lib/index.d.ts:206
Extends
Constructors
Constructor
new Entropy(
arg):Entropy
Defined in: @nimiq/core/lib/index.d.ts:213
Creates a new Entropy from a byte array.
Parameters
arg
Uint8Array
Returns
Entropy
Overrides
Properties
ENCRYPTION_CHECKSUM_SIZE
staticENCRYPTION_CHECKSUM_SIZE:number
Defined in: @nimiq/core/lib/index.d.ts:181
Inherited from
Secret.ENCRYPTION_CHECKSUM_SIZE
ENCRYPTION_CHECKSUM_SIZE_V3
staticENCRYPTION_CHECKSUM_SIZE_V3:number
Defined in: @nimiq/core/lib/index.d.ts:182
Inherited from
Secret.ENCRYPTION_CHECKSUM_SIZE_V3
ENCRYPTION_KDF_ROUNDS
staticENCRYPTION_KDF_ROUNDS:number
Defined in: @nimiq/core/lib/index.d.ts:180
Inherited from
ENCRYPTION_SALT_SIZE
staticENCRYPTION_SALT_SIZE:number
Defined in: @nimiq/core/lib/index.d.ts:179
Inherited from
PURPOSE_ID
staticPURPOSE_ID:number
Defined in: @nimiq/core/lib/index.d.ts:208
SIZE
staticSIZE:number
Defined in: @nimiq/core/lib/index.d.ts:207
Overrides
Accessors
encryptedSize
Get Signature
get encryptedSize():
number
Defined in: @nimiq/core/lib/index.d.ts:196
Returns the serialized size of this object when encrypted.
Returns
number
Inherited from
serializedSize
Get Signature
get serializedSize():
number
Defined in: @nimiq/core/lib/index.d.ts:241
Returns the serialized size of this Entropy.
Returns
number
Methods
compare()
compare(
o):number
Defined in: @nimiq/core/lib/index.d.ts:97
Compares this object to another object.
Returns a negative number if this is smaller than o, a positive number if this is larger than o, and zero if equal.
Parameters
o
Serializable
Returns
number
Inherited from
equals()
equals(
o):boolean
Defined in: @nimiq/core/lib/index.d.ts:249
Checks for equality with another Entropy.
Parameters
o
unknown
Returns
boolean
Overrides
exportEncrypted()
exportEncrypted(
key):Promise<SerialBuffer>
Defined in: @nimiq/core/lib/index.d.ts:192
Encrypts the Secret with a password.
Parameters
key
Uint8Array
Returns
Promise<SerialBuffer>
Inherited from
overwrite()
overwrite(
entropy):void
Defined in: @nimiq/core/lib/index.d.ts:245
Overwrites this Entropy's bytes with a replacement in-memory
Parameters
entropy
Entropy
Returns
void
serialize()
serialize(
buf?):SerialBuffer
Defined in: @nimiq/core/lib/index.d.ts:237
Serializes the Entropy to a byte array.
Parameters
buf?
Returns
Overrides
toBase64()
toBase64():
string
Defined in: @nimiq/core/lib/index.d.ts:106
Formats the object into a base64 string.
Returns
string
Inherited from
toExtendedPrivateKey()
toExtendedPrivateKey(
password?,wordlist?):ExtendedPrivateKey
Defined in: @nimiq/core/lib/index.d.ts:221
Derives an ExtendedPrivateKey from the Entropy.
Parameters
password?
string
wordlist?
string[]
Returns
toHex()
toHex():
string
Defined in: @nimiq/core/lib/index.d.ts:110
Formats the object into a hex string.
Returns
string
Inherited from
toMnemonic()
toMnemonic(
wordlist?):string[]
Defined in: @nimiq/core/lib/index.d.ts:225
Converts the Entropy into a mnemonic.
Parameters
wordlist?
string[]
Returns
string[]
toString()
toString():
string
Defined in: @nimiq/core/lib/index.d.ts:102
Formats the object into a hex string.
Returns
string
Inherited from
deserialize()
staticdeserialize(buf):Entropy
Defined in: @nimiq/core/lib/index.d.ts:229
Deserializes an Entropy object from a byte array.
Parameters
buf
Returns
Entropy
exportEncrypted()
staticexportEncrypted(secret,key):Promise<SerialBuffer>
Defined in: @nimiq/core/lib/index.d.ts:188
Parameters
secret
Secret | PrivateKey
key
Uint8Array
Returns
Promise<SerialBuffer>
Inherited from
fromEncrypted()
staticfromEncrypted(buf,key):Promise<Entropy|PrivateKey>
Defined in: @nimiq/core/lib/index.d.ts:187
Decrypts a Secret from an encrypted byte array and its password.
Parameters
buf
key
Uint8Array
Returns
Promise<Entropy | PrivateKey>
Inherited from
fromHex()
staticfromHex(hex):Entropy
Defined in: @nimiq/core/lib/index.d.ts:233
Deserializes an Entropy object from a hex string.
Parameters
hex
string
Returns
Entropy
generate()
staticgenerate():Entropy
Defined in: @nimiq/core/lib/index.d.ts:217
Generates a new Entropy object from secure randomness.
Returns
Entropy