Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/scrypt/lib/scrypt.ts>scrypt

🔑 Deno library for hashing passwords using scrypt
Go to Latest
function scrypt
import { scrypt } from "https://deno.land/x/scrypt@v4.4.3/lib/scrypt.ts";

Scrypt implementation using web assembly

Parameters

password: string | Uint8Array
  • string to hash
salt: string | Uint8Array
N: number
  • CPU/Memory cost parameter. Must be a power of 2 smaller than 2^(128*r/8)
r: number
  • block size
p: number
  • parallelism factor
optional
dklen: number
  • length (in bytes) of the output. Defaults to 32.
optional
outputEncoding: encoding
  • encoding used, defaults to null (Uint8Array)

Returns

Uint8Array | string
  • the resulting hash encoded according to outputEncoding