Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
node bindings for crypto_scrypt
C C++ Python JavaScript
branch: master


node bindings for crypto_scrypt from scrypt

Build Status


var scrypt = require('scrypt-hash')

var password = Buffer('aprettybadpassword')
var salt = Buffer('adashofsalt')
var N = 1024 * 64
var r = 8
var p = 1
var len = 32

scrypt(password, salt, N, r, p, len, function (err, hash) {
    if (err) {
        return console.error(err)
    console.assert(hash.length === len)
    console.log('The hashed password is', hash.toString('hex'))

scrypt(data, salt, N, r, p, len, callback)


  • data - Buffer - the value you want to hash
  • salt - Buffer
  • N - Number - must be 32bit integer and a power of 2
  • r - Number
  • p - Number
  • len - Number - length of the returned hash
  • callback - function (err, hash)
    • err - Error
    • hash - Buffer

For info on what N, r, p do see


Major and Minor version numbers follow the scrypt C source. The Patch number of this library may differ from the upstream version as changes to either will increment this one.


BSD 2-Clause, Copyright 2013 Danny Coates

scrypt licensed under BSD 2-Clause, Copyright 2009 Colin Percival

Something went wrong with that request. Please try again.