hextreme
Version:
Encode/decode hex and base64 at speed
43 lines (40 loc) • 1.95 kB
text/typescript
// Generated by dts-bundle-generator v9.5.1
export interface ToHexOptions {
alphabet?: "lower" | "upper";
}
export interface _ToHexOptions extends ToHexOptions {
scratchArr?: Uint16Array;
}
export declare function _toHex(in8: Uint8Array, { alphabet, scratchArr }?: _ToHexOptions): string;
export declare function _toHexChunked(d: Uint8Array, options?: ToHexOptions): string;
export declare function toHex(d: Uint8Array, options?: ToHexOptions): string;
export interface FromHexOptions {
onInvalidInput?: "throw" | "truncate";
outArray?: Uint8Array;
}
export interface _FromHexOptions extends FromHexOptions {
scratchArray?: Uint16Array;
indexOffset?: number;
}
export declare function _fromHex(s: string, { onInvalidInput, scratchArray: scratchArr, outArray: outArr, indexOffset }?: _FromHexOptions): Uint8Array<ArrayBuffer>;
export declare function _fromHexChunked(s: string, { onInvalidInput, outArray }?: FromHexOptions): Uint8Array<ArrayBuffer>;
export declare function fromHex(s: string, options?: FromHexOptions): Uint8Array<ArrayBuffer>;
export interface Base64Options {
alphabet?: "base64" | "base64url";
}
export interface ToBase64Options extends Base64Options {
omitPadding?: boolean;
}
export interface _ToBase64Options extends ToBase64Options {
scratchArr?: Uint32Array;
}
export declare function _toBase64(d: Uint8Array, { omitPadding, alphabet, scratchArr }?: _ToBase64Options): string;
export declare function _toBase64Chunked(d: Uint8Array, options?: ToBase64Options): string;
export declare function toBase64(d: Uint8Array, options?: ToBase64Options): string;
export interface FromBase64Options {
alphabet?: Base64Options["alphabet"] | "base64any";
onInvalidInput?: "throw" | "skip";
}
export declare function _fromBase64(s: string, { alphabet, onInvalidInput }?: FromBase64Options): Uint8Array<ArrayBuffer>;
export declare function fromBase64(s: string, options?: FromBase64Options): Uint8Array<ArrayBuffer>;
export {};