csp-toolkit
Version:
A comprehensive toolkit for working with Content Security Policy (CSP) directives in TypeScript.
15 lines • 507 B
TypeScript
import { HashAlgorithms } from "./types";
/**
* Take a string and generate a hash
* @param str - The string to hash
* @param algorithm - The algorithm to use
* @returns A hash of your string
*/
export declare const generateHash: (str: string, algorithm: HashAlgorithms) => string;
/**
* Generates a nonce. To be used server side, generate one per request
* @returns A nonsensical string
*/
export declare const generateNonce: () => string;
export * from "./types";
//# sourceMappingURL=node.d.ts.map