/**
 * @module crypto  
 * This module contains various cryptographic functions, like compression and ArrayBuffer encoding - [see the documentation for more info](https://github.com/Sv443-Network/CoreUtils/blob/main/docs.md#crypto)  
 */
import type { Stringifiable } from "./types.js";
/** Converts an ArrayBuffer to a base64-encoded (ASCII) string */
export declare function abtoa(buf: ArrayBuffer): string;
/** Converts a base64-encoded (ASCII) string to an ArrayBuffer representation of its bytes */
export declare function atoab(str: string): ArrayBuffer;
/** Compresses a string or an ArrayBuffer using the provided {@linkcode compressionFormat} and returns it as a base64 string */
export declare function compress(input: Stringifiable | ArrayBuffer, compressionFormat: CompressionFormat, outputType?: "string"): Promise<string>;
/** Compresses a string or an ArrayBuffer using the provided {@linkcode compressionFormat} and returns it as an ArrayBuffer */
export declare function compress(input: Stringifiable | ArrayBuffer, compressionFormat: CompressionFormat, outputType: "arrayBuffer"): Promise<ArrayBuffer>;
/** Decompresses a previously compressed base64 string or ArrayBuffer, with the format passed by {@linkcode compressionFormat}, converted to a string */
export declare function decompress(input: Stringifiable | ArrayBuffer, compressionFormat: CompressionFormat, outputType?: "string"): Promise<string>;
/** Decompresses a previously compressed base64 string or ArrayBuffer, with the format passed by {@linkcode compressionFormat}, converted to an ArrayBuffer */
export declare function decompress(input: Stringifiable | ArrayBuffer, compressionFormat: CompressionFormat, outputType: "arrayBuffer"): Promise<ArrayBuffer>;
/**
 * Creates a hash / checksum of the given {@linkcode input} string or ArrayBuffer using the specified {@linkcode algorithm} ("SHA-256" by default).  
 *  
 * - ⚠️ Uses the SubtleCrypto API so it needs to run in a secure context (HTTPS).  
 * - ⚠️ If you use this for cryptography, make sure to use a secure algorithm (under no circumstances use SHA-1) and to [salt](https://en.wikipedia.org/wiki/Salt_(cryptography)) your input data.  
 */
export declare function computeHash(input: string | ArrayBuffer, algorithm?: string): Promise<string>;
/**
 * Generates a random ID with the specified length and radix (16 characters and hexadecimal by default)  
 *  
 * - ⚠️ Not suitable for generating anything related to cryptography! Use [SubtleCrypto's `generateKey()`](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/generateKey) for that instead.  
 * @param length The length of the ID to generate (defaults to 16)  
 * @param radix The [radix](https://en.wikipedia.org/wiki/Radix) of each digit (defaults to 16 which is hexadecimal. Use 2 for binary, 10 for decimal, 36 for alphanumeric, etc.)  
 * @param enhancedEntropy If set to true, uses [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) for better cryptographic randomness (this also makes it take longer to generate)  
 * @param randomCase If set to false, the generated ID will be lowercase only - also makes use of the `enhancedEntropy` parameter unless the output doesn't contain letters  
 */
export declare function randomId(length?: number, radix?: number, enhancedEntropy?: boolean, randomCase?: boolean): string;
