c32check
Version:
Crockford base-32 checksum encoding
14 lines (13 loc) • 638 B
TypeScript
/**
* Encode a hex string as a c32check string. This is a lot like how
* base58check works in Bitcoin-land, but this algorithm uses the
* z-base-32 alphabet instead of the base58 alphabet. The algorithm
* is as follows:
* * calculate the c32checksum of version + data
* * c32encode version + data + c32checksum
* @param {number} version - the version string (between 0 and 31)
* @param {string} data - the data to encode
* @returns {string} the c32check representation
*/
export declare function c32checkEncode(version: number, data: string): string;
export declare function c32checkDecode(c32data: string): [number, string];