Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/scrypt/lib/format.ts

๐Ÿ”‘ Deno library for hashing passwords using scrypt
Go to Latest
import * as scrypt from "https://deno.land/x/scrypt@v4.4.0/lib/format.ts";

Functions

Retrieve scrypt parameters from a supported formatted hash

Guess the format of a hash based on its prefix It's technically possible for the raw hash to start with a colliding prefix, but it's very unlikely

Format hash as a PHC format string (a stricter subset of Modular Crypt Format created for argon2) This format is fully compatible with MCF and this implementation is based on passlib Salt and hash are saved as base64 encoded strings without padding

Format hash using HMAC-based format from node-scrypt based on the original tarsnap scrypt encrypted data format

Interfaces

Available parameters primarily influencing security (and runtime) of scrypt

Type Aliases

Available formats for scrypt hashes scrypt - original scrypt format, see (https://github.com/Tarsnap/scrypt/blob/master/FORMAT). This is the default format. phc - PHC format, a stricter subset of Modular Crypt Format created for argon2. raw - raw hash, without any additional data. Can't be used to verify the hash without also passing the parameters used to generate it.