UNPKG

@arcblock/did

Version:
23 lines (22 loc) 616 B
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 };