Options
All
  • Public
  • Public/Protected
  • All
Menu

@cosmjs/crypto Documentation

Index

Type Aliases

HdPath: readonly Slip10RawIndex[]

An array of raw SLIP10 indices.

This can be constructed via string parsing:

import { stringToPath } from "@cosmjs/crypto";

const path = stringToPath("m/0'/1/2'/2/1000000000");

or manually:

import { HdPath, Slip10RawIndex } from "@cosmjs/crypto";

// m/0'/1/2'/2/1000000000
const path: HdPath = [
Slip10RawIndex.hardened(0),
Slip10RawIndex.normal(1),
Slip10RawIndex.hardened(2),
Slip10RawIndex.normal(2),
Slip10RawIndex.normal(1000000000),
];

Variables

xchacha20NonceLength: 24 = 24

Nonce length in bytes for all flavours of XChaCha20.

see

https://libsodium.gitbook.io/doc/advanced/stream_ciphers/xchacha20#notes

Functions

  • keccak256(data: Uint8Array): Uint8Array
  • Convenience function equivalent to new Keccak256(data).digest()

    Parameters

    • data: Uint8Array

    Returns Uint8Array

  • pathToString(path: HdPath): string
  • ripemd160(data: Uint8Array): Uint8Array
  • Convenience function equivalent to new Ripemd160(data).digest()

    Parameters

    • data: Uint8Array

    Returns Uint8Array

  • sha256(data: Uint8Array): Uint8Array
  • Convenience function equivalent to new Sha256(data).digest()

    Parameters

    • data: Uint8Array

    Returns Uint8Array

  • sha512(data: Uint8Array): Uint8Array
  • Convenience function equivalent to new Sha512(data).digest()

    Parameters

    • data: Uint8Array

    Returns Uint8Array

  • slip10CurveFromString(curveString: string): Slip10Curve
  • stringToPath(input: string): HdPath

Generated using TypeDoc