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

Methods

  • Parameters

    • string: string
    • Optionalencoding: Encoding

    Returns Uint8Array

  • Parameters

    Returns string

  • Type Parameters

    • T

    Parameters

    Returns Promise<T>

  • Parameters

    • data: Uint8Array
    • key: Uint8Array
    • iv: Uint8Array

    Returns Promise<Uint8Array>

  • Type Parameters

    • T

    Parameters

    • password: string
    • data: T

    Returns Promise<Keystore>

  • Parameters

    • data: Uint8Array
    • key: Uint8Array
    • iv: Uint8Array

    Returns Promise<Uint8Array>

  • Parameters

    • data: Uint8Array

    Returns Uint8Array

  • Parameters

    • password: string
    • saltBuffer: Uint8Array

    Returns Uint8Array

  • Parameters

    • password: BytesLike
    • salt: BytesLike
    • iterations: number
    • keylen: number
    • algo: "sha256" | "sha512"

    Returns string

  • Parameters

    • length: number

    Returns Uint8Array

  • Returns string

  • Parameters

    Returns Uint8Array

  • Parameters

    Returns Uint8Array

  • Parameters

    • buffer: Uint8Array
    • Optionalencoding: Encoding

    Returns string