interface CryptoApi { bufferFromString(string: string,
encoding?: Encoding): Uint8Array<ArrayBufferLike>; computeHmac(algorithm: "sha256" | "sha512",
key: BytesLike,
data: BytesLike): string; decrypt<T>(password: string,
keystore: Keystore): Promise<T>; decryptJsonWalletData(data: Uint8Array<ArrayBufferLike>,
key: Uint8Array<ArrayBufferLike>,
iv: Uint8Array<ArrayBufferLike>): Promise<Uint8Array<ArrayBufferLike>>; encrypt<T>(password: string,
data: T): Promise<Keystore>; encryptJsonWalletData(data: Uint8Array<ArrayBufferLike>,
key: Uint8Array<ArrayBufferLike>,
iv: Uint8Array<ArrayBufferLike>): Promise<Uint8Array<ArrayBufferLike>>; keccak256(data: Uint8Array<ArrayBufferLike>): Uint8Array<ArrayBufferLike>; keyFromPassword(password: string,
saltBuffer: Uint8Array<ArrayBufferLike>): Uint8Array<ArrayBufferLike>; pbkdf2(password: BytesLike,
salt: BytesLike,
iterations: number,
keylen: number,
algo: "sha256" | "sha512"): string; randomBytes(length: number): Uint8Array<ArrayBufferLike>; randomUUID(): string; ripemd160(data: BytesLike): Uint8Array<ArrayBufferLike>; scrypt(params: IScryptParams): Uint8Array<ArrayBufferLike>; stringFromBuffer(buffer: Uint8Array<ArrayBufferLike>,
encoding?: Encoding): string; } Methods
bufferFromString
- bufferFromString(string, encoding?): Uint8Array<ArrayBufferLike>
Parameters
- string: string
Optional
encoding: Encoding
Returns Uint8Array<ArrayBufferLike>
computeHmac
- computeHmac(algorithm, key, data): string
Returns string
decrypt
- decrypt<T>(password, keystore): Promise<T>
Returns Promise<T>
decryptJsonWalletData
- decryptJsonWalletData(data, key, iv): Promise<Uint8Array<ArrayBufferLike>>
Parameters
- data: Uint8Array<ArrayBufferLike>
- key: Uint8Array<ArrayBufferLike>
- iv: Uint8Array<ArrayBufferLike>
Returns Promise<Uint8Array<ArrayBufferLike>>
encryptJsonWalletData
- encryptJsonWalletData(data, key, iv): Promise<Uint8Array<ArrayBufferLike>>
Parameters
- data: Uint8Array<ArrayBufferLike>
- key: Uint8Array<ArrayBufferLike>
- iv: Uint8Array<ArrayBufferLike>
Returns Promise<Uint8Array<ArrayBufferLike>>
keccak256
- keccak256(data): Uint8Array<ArrayBufferLike>
Parameters
- data: Uint8Array<ArrayBufferLike>
Returns Uint8Array<ArrayBufferLike>
keyFromPassword
- keyFromPassword(password, saltBuffer): Uint8Array<ArrayBufferLike>
Parameters
- password: string
- saltBuffer: Uint8Array<ArrayBufferLike>
Returns Uint8Array<ArrayBufferLike>
pbkdf2
- pbkdf2(password, salt, iterations, keylen, algo): string
Parameters
- password: BytesLike
- salt: BytesLike
- iterations: number
- keylen: number
- algo: "sha256" | "sha512"
Returns string
randomBytes
- randomBytes(length): Uint8Array<ArrayBufferLike>
Returns Uint8Array<ArrayBufferLike>
randomUUID
- randomUUID(): string
Returns string
ripemd160
- ripemd160(data): Uint8Array<ArrayBufferLike>
Returns Uint8Array<ArrayBufferLike>
scrypt
- scrypt(params): Uint8Array<ArrayBufferLike>
Returns Uint8Array<ArrayBufferLike>
stringFromBuffer
- stringFromBuffer(buffer, encoding?): string
Parameters
- buffer: Uint8Array<ArrayBufferLike>
Optional
encoding: Encoding
Returns string