UNPKG

@arcblock/did

Version:

Javascript lib to work with ArcBlock DID

25 lines (24 loc) 673 B
import { BN } from "@ocap/util"; //#region src/util.d.ts 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<ArrayBufferLike>; /** * 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) => string; //#endregion export { DID_PREFIX, toBits, toBytes, toStrictHex };