//#region src/common/data/basex-secure.d.ts /** * @__NO_SIDE_EFFECTS__ */ declare function assertNumber(n: number): void; interface Coder { encode(from: F): T; decode(to: T): F; } interface BytesCoder extends Coder { encode: (data: Uint8Array) => string; decode: (str: string) => Uint8Array; } type BaseXChain = [Coder, ...Coder[]]; type BaseXInput = F extends Coder ? T : never; type BaseXOutput = F extends Coder ? T : never; type BaseXFirst = T extends [infer U, ...any[]] ? U : never; type BaseXLast = T extends [...any[], infer U] ? U : never; type BaseXTail = T extends [any, ...infer U] ? U : never; type BaseXAsChain> = { [K in keyof C]: Coder, BaseXInput> }; /** * @__NO_SIDE_EFFECTS__ */ declare function chain>(...args: T): Coder>, BaseXOutput>>; type BaseXAlphabet = string[] | string; /** * Encodes integer radix representation to array of strings using alphabet and back * @__NO_SIDE_EFFECTS__ */ declare function alphabet(alphabet: BaseXAlphabet): Coder; /** * @__NO_SIDE_EFFECTS__ */ declare function join(separator?: string): Coder; /** * Pad strings array so it has integer number of bits * @__NO_SIDE_EFFECTS__ */ declare function padding(bits: number, chr?: string): Coder; /** * Slow: O(n^2) time complexity * @__NO_SIDE_EFFECTS__ */ declare function convertRadix(data: number[], from: number, to: number): number[]; /** * Implemented with numbers, because BigInt is 5x slower * @__NO_SIDE_EFFECTS__ */ declare function convertRadix2(data: number[], from: number, to: number, padding: boolean): number[]; /** * @__NO_SIDE_EFFECTS__ */ declare function radix(num: number): Coder; /** * If both bases are power of same number (like `2**8 <-> 2**64`), * there is a linear algorithm. For now we have implementation for power-of-two bases only. * @__NO_SIDE_EFFECTS__ */ declare function radix2(bits: number, revPadding?: boolean): Coder; /** * @__NO_SIDE_EFFECTS__ */ declare function checksum(len: number, fn: (data: Uint8Array) => Uint8Array): Coder; declare const utils: { alphabet: typeof alphabet; chain: typeof chain; checksum: typeof checksum; convertRadix: typeof convertRadix; convertRadix2: typeof convertRadix2; radix: typeof radix; radix2: typeof radix2; join: typeof join; padding: typeof padding; }; declare const base16: BytesCoder; declare const base32: BytesCoder; declare const base32nopad: BytesCoder; declare const base32hex: BytesCoder; declare const base32hexnopad: BytesCoder; declare const base32agnoster: BytesCoder; declare const base32crockford: BytesCoder; declare const base64: BytesCoder; declare const base64nopad: BytesCoder; declare const base64url: BytesCoder; declare const base64urlnopad: BytesCoder; declare const base58: BytesCoder; declare const base58flickr: BytesCoder; declare const base58xrp: BytesCoder; declare const base58xmr: BytesCoder; declare const createBase58check: (sha256: (data: Uint8Array) => Uint8Array) => BytesCoder; declare const base58check: (sha256: (data: Uint8Array) => Uint8Array) => BytesCoder; interface Bech32Decoded { prefix: Prefix; words: number[]; } interface Bech32DecodedWithArray { prefix: Prefix; words: number[]; bytes: Uint8Array; } interface Bech32 { encode(prefix: Prefix, words: number[] | Uint8Array, limit?: number | false): `${Lowercase}1${string}`; decode(str: `${Prefix}1${string}`, limit?: number | false): Bech32Decoded; encodeFromBytes(prefix: string, bytes: Uint8Array): string; decodeToBytes(str: string): Bech32DecodedWithArray; decodeUnsafe(str: string, limit?: number | false): void | Bech32Decoded; fromWords(to: number[]): Uint8Array; fromWordsUnsafe(to: number[]): void | Uint8Array; toWords(from: Uint8Array): number[]; } declare const bech32: Bech32; declare const bech32m: Bech32; declare const utf8: BytesCoder; declare const hex: BytesCoder; declare const CODERS: { utf8: BytesCoder; hex: BytesCoder; base16: BytesCoder; base32: BytesCoder; base64: BytesCoder; base64url: BytesCoder; base58: BytesCoder; base58xmr: BytesCoder; }; type CoderType = keyof typeof CODERS; declare const bytesToString: (type: CoderType, bytes: Uint8Array) => string; declare const str: (type: CoderType, bytes: Uint8Array) => string; declare const stringToBytes: (type: CoderType, str: string) => Uint8Array; declare const bytes: (type: CoderType, str: string) => Uint8Array; //#endregion export { base64urlnopad as A, utils as B, base58check as C, base64 as D, base58xrp as E, createBase58check as F, hex as I, str as L, bech32m as M, bytes as N, base64nopad as O, bytesToString as P, stringToBytes as R, base58 as S, base58xmr as T, base32agnoster as _, BaseXInput as a, base32hexnopad as b, BaseXTail as c, Bech32DecodedWithArray as d, BytesCoder as f, base32 as g, base16 as h, BaseXFirst as i, bech32 as j, base64url as k, Bech32 as l, assertNumber as m, BaseXAsChain as n, BaseXLast as o, Coder as p, BaseXChain as r, BaseXOutput as s, BaseXAlphabet as t, Bech32Decoded as u, base32crockford as v, base58flickr as w, base32nopad as x, base32hex as y, utf8 as z }; //# sourceMappingURL=basex-secure-Cn6hLMwc.d.mts.map