mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
12 lines
417 B
TypeScript
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);
|