@arcblock/did
Version:
Javascript lib to work with ArcBlock DID
23 lines (22 loc) • 616 B
TypeScript
import { BN } from '@ocap/util';
declare const DID_PREFIX = "did:abt:";
/**
* Convert did to bytes with length of 26
*
* @param {string} did
* @returns {Buffer}
*/
declare const toBytes: (did: string) => Buffer;
/**
* Convert number to bit string with predefined length
*/
declare const toBits: (number: string | number | BN, length: number) => string;
/**
* Ensure the hex length is even number, 2, 4, 6, 8
*
* @param {string} hex
* @param {number} length
* @returns {string} hex
*/
declare const toStrictHex: (hex: string, length?: number) => any;
export { DID_PREFIX, toBits, toBytes, toStrictHex };