/** * A single parsed SRI (Subresource Integrity) hash, e.g. one * `sha512-` segment of a lockfile `integrity` value. */ export interface IntegrityHash { algorithm: string; digestBase64: string; } /** * Parses an SRI string (one or more space-separated `algorithm-base64` * entries) into its supported hashes, unknown algorithms excluded. */ export declare function parseIntegrity(integrity: string): IntegrityHash[]; /** * Returns the strongest supported hash of an SRI string, or undefined if * none of its entries use a supported algorithm. */ export declare function strongestIntegrityHash(integrity: string): IntegrityHash | undefined; /** * Verifies content against an SRI string using its strongest supported * hash. Returns false when no supported hash is present. */ export declare function verifyIntegrity(content: Buffer, integrity: string): boolean; /** * The hex encoding of an SRI hash's digest. npm's cacache stores content * under this encoding, e.g. `content-v2/sha512///`. */ export declare function integrityHashToHex(hash: IntegrityHash): string;