alinea
Version:
Headless git-based CMS
27 lines (26 loc) • 904 B
TypeScript
/**
* Computes the SHA-1 hash bytes of the input data.
*/
export declare function sha1Bytes(data: Uint8Array): Promise<Uint8Array>;
/**
* Computes the SHA-1 hash of the input data.
*/
export declare function sha1Hash(data: Uint8Array): Promise<string>;
/**
* Concatenates multiple Uint8Arrays into a single Uint8Array.
*/
export declare function concatUint8Arrays(arrays: Uint8Array[]): Uint8Array;
/**
* Converts a hexadecimal string to a Uint8Array.
*/
export declare function hexToBytes(hex: string): Uint8Array;
/**
* Converts a Uint8Array to a hexadecimal string.
*/
export declare function bytesToHex(bytes: Uint8Array): string;
/**
* Compares two strings for sorting.
* See: https://stackoverflow.com/a/40355107/2168416
*/
export declare function compareStrings(a: string, b: string): number;
export declare function splitPath(path: string): [name: string, rest: string | undefined];