UNPKG

@iacobus/hd

Version:

Hierarchical Deterministic Symmetric Keys.

17 lines 1 kB
/** * @fileoverview Exports utility functions. * @author Jacob V. B. Haap <iacobus.xyz> * @license MIT */ import type { CHash } from "@noble/hashes/utils"; /** calcSalt creates a 16 byte salt from a given hash, message, and optional context info. */ export declare function calcSalt(h: CHash, msg: Uint8Array, info?: Uint8Array): Uint8Array; /** encodeInt encodes a given integer as a 4 byte Uint8Array. */ export declare function encodeInt(int: number): Uint8Array; /** strToIndex obtains a 32 bit integer from a given hash and string. */ export declare function strToIndex(h: CHash, str: string): number; /** getIndex obtains a 32 bit integer index from a given hash, index string, and type. */ export declare function getIndex(h: CHash, index: string, type: string): number; /** fingerprint calculates a fingerprint from a given hash, parent key, and child key. */ export declare function fingerprint(h: CHash, parent: Uint8Array, child: Uint8Array): Uint8Array; //# sourceMappingURL=utils.d.ts.map