Skip to content

Migrate from scrypt

Simone Primarosa edited this page Sep 7, 2017 · 1 revision

Let's users be your collection of registered users. Each of those users should have the hash computed with scrypt stored somewhere. We will assume that this was stored in scrypt property of each user.

users.forEach(user => {
  var hash = JSON.stringify({
    hash: user.scrypt,
    func: 'scrypt'
  });
  user.hash = hash;  // Now you can pass user.hash to the verify function of
                     // this package.
});
Clone this wiki locally