DefinitelyTyped/types/node-phpass/node-phpass-tests.ts
Glenn Reyes accdb12060
Add node-phpass (#42894)
* Add node-phpass

* Add tests
2020-03-06 14:35:20 -08:00

12 lines
417 B
TypeScript

import { CRYPT_BLOWFISH, CRYPT_EXT_DES, PasswordHash } from 'node-phpass';
const hasher: PasswordHash = new PasswordHash();
const hash: Promise<string> = hasher.HashPassword('foo').then(hash => {
hasher.CheckPassword('foo', hash);
return hash;
});
const blowfishHasher: PasswordHash = new PasswordHash(8, true, CRYPT_BLOWFISH);
const extDesHasher: PasswordHash = new PasswordHash(8, false, CRYPT_EXT_DES);