Creates a secret key object.
Optional
config: { buffer?: ArrayBufferLike; size?: number } = {}Configuration options.
Optional
buffer?: ArrayBufferLikeSecret key buffer.
Optional
size?: numberNumber of random bytes to generate, ignored if 'buffer' is provided.
Base32 string representation of secret key.
Hexadecimal string representation of secret key.
Latin-1 string representation of secret key.
UTF-8 string representation of secret key.
Static
fromConverts a base32 string to a Secret object.
Base32 string.
Secret object.
Static
fromConverts a hexadecimal string to a Secret object.
Hexadecimal string.
Secret object.
Static
fromConverts a Latin-1 string to a Secret object.
Latin-1 string.
Secret object.
Static
fromUTF8Converts an UTF-8 string to a Secret object.
UTF-8 string.
Secret object.
OTP secret key.