mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
17 lines
434 B
TypeScript
17 lines
434 B
TypeScript
/// <reference path="credential.d.ts" />
|
|
|
|
import * as credential from 'credential';
|
|
|
|
credential.hash('password', function(err: Error, hash: string) {
|
|
if (err) console.error(err);
|
|
else console.log(hash);
|
|
});
|
|
|
|
const hash = '{}';
|
|
const password = 'test';
|
|
|
|
credential.verify(hash, password, function(err: Error, isValid: boolean) {
|
|
if (err) console.error(err);
|
|
else console.log(isValid ? 'Password match' : 'Incorrect password');
|
|
});
|