Skip to content

Class: Entropy

Defined in: @nimiq/core/lib/index.d.ts:206

Extends

Constructors

new Entropy()

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

Secret.constructor

Properties

ENCRYPTION_CHECKSUM_SIZE

static ENCRYPTION_CHECKSUM_SIZE: number

Defined in: @nimiq/core/lib/index.d.ts:181

Inherited from

Secret.ENCRYPTION_CHECKSUM_SIZE


ENCRYPTION_CHECKSUM_SIZE_V3

static ENCRYPTION_CHECKSUM_SIZE_V3: number

Defined in: @nimiq/core/lib/index.d.ts:182

Inherited from

Secret.ENCRYPTION_CHECKSUM_SIZE_V3


ENCRYPTION_KDF_ROUNDS

static ENCRYPTION_KDF_ROUNDS: number

Defined in: @nimiq/core/lib/index.d.ts:180

Inherited from

Secret.ENCRYPTION_KDF_ROUNDS


ENCRYPTION_SALT_SIZE

static ENCRYPTION_SALT_SIZE: number

Defined in: @nimiq/core/lib/index.d.ts:179

Inherited from

Secret.ENCRYPTION_SALT_SIZE


PURPOSE_ID

static PURPOSE_ID: number

Defined in: @nimiq/core/lib/index.d.ts:208


SIZE

static SIZE: number

Defined in: @nimiq/core/lib/index.d.ts:207

Overrides

Secret.SIZE

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

Secret.encryptedSize


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

Secret.compare


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

Secret.equals


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

Secret.exportEncrypted


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?

SerialBuffer

Returns

SerialBuffer

Overrides

Secret.serialize


toBase64()

toBase64(): string

Defined in: @nimiq/core/lib/index.d.ts:106

Formats the object into a base64 string.

Returns

string

Inherited from

Secret.toBase64


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

ExtendedPrivateKey


toHex()

toHex(): string

Defined in: @nimiq/core/lib/index.d.ts:110

Formats the object into a hex string.

Returns

string

Inherited from

Secret.toHex


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

Secret.toString


deserialize()

static deserialize(buf): Entropy

Defined in: @nimiq/core/lib/index.d.ts:229

Deserializes an Entropy object from a byte array.

Parameters

buf

SerialBuffer

Returns

Entropy


exportEncrypted()

static exportEncrypted(secret, key): Promise<SerialBuffer>

Defined in: @nimiq/core/lib/index.d.ts:188

Parameters

secret

PrivateKey | Secret

key

Uint8Array

Returns

Promise<SerialBuffer>

Inherited from

Secret.exportEncrypted


fromEncrypted()

static fromEncrypted(buf, key): Promise<PrivateKey | Entropy>

Defined in: @nimiq/core/lib/index.d.ts:187

Decrypts a Secret from an encrypted byte array and its password.

Parameters

buf

SerialBuffer

key

Uint8Array

Returns

Promise<PrivateKey | Entropy>

Inherited from

Secret.fromEncrypted


fromHex()

static fromHex(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()

static generate(): Entropy

Defined in: @nimiq/core/lib/index.d.ts:217

Generates a new Entropy object from secure randomness.

Returns

Entropy