mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
34 lines
757 B
TypeScript
34 lines
757 B
TypeScript
/// <reference path="bcrypt.d.ts" />
|
|
|
|
import bcrypt = require("bcrypt");
|
|
|
|
var num: number;
|
|
var str: string;
|
|
var bool: boolean;
|
|
|
|
str = bcrypt.genSaltSync();
|
|
str = bcrypt.genSaltSync(num);
|
|
|
|
bcrypt.genSalt(function (err: Error, salt: string): void {
|
|
str = salt;
|
|
});
|
|
bcrypt.genSalt(num, function (err: Error, salt: string): void {
|
|
str = salt;
|
|
});
|
|
|
|
str = bcrypt.hashSync(str, str);
|
|
str = bcrypt.hashSync(str, num);
|
|
|
|
bcrypt.hash(str, str, function (err: Error, encrypted: string):void {
|
|
str = encrypted;
|
|
})
|
|
bcrypt.hash(str, num, function (err: Error, encrypted: string): void {
|
|
str = encrypted;
|
|
});
|
|
|
|
bool = bcrypt.compareSync(str, str);
|
|
bcrypt.compare(str, str, function (err: Error, same: boolean): void {
|
|
bool = same;
|
|
});
|
|
|
|
num = bcrypt.getRounds(str); |