1.4.0 • Published 2 years ago

@inanna/pw v1.4.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Usage

import {PBKDF2, PW} from '@inanna/pw'
// or import {Scrypt, PW} from '@inanna/pw'

// Create KDF

const kdf = new PBKDF2({pwlen: 6});

// Create and encrypt password

const pw = await kdf.pw('123456');

// Check password

console.log(await pw.check('123456')); // return true
console.log(await pw.check('foo')); // return false

// Export password

const jsonPW = JSON.stringify(pw);

// Import password

const pw2 = PW.from(jsonPW)

// Import null-password

const nopw = PW.from(null);
console.log(await nopw.check('any password')); // return false
console.log(JSON.stringify(nopw)); // return 'null'

Contents

1.4.0

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago