UNPKG

@iobroker/js-controller-common-db

Version:

The Library contains the common utils for the ioBroker controller which can be used by db classes too, as they do not rely on the db (circular dependencies).

37 lines (31 loc) 1.16 kB
/** * * password hash and check * * 7'2014-2024 Bluefox <dogafox@gmail.com> * 2014 hobbyquaker <hq@ccu.io> * * derived from https://github.com/florianheinemann/password-hash-and-salt/ (MIT License) * * The created hash is of the following format: <algorithm>$<iterations>$<hash>$<salt> * * Usage Example: var password = require('./lib/password.js'); password('test').hash(null, null, function (err, res) { console.log(res); password('test').check(res, function (err, res) { console.log('test: ' + res); }); password('muh').check(res, function (err, res) { console.log('muh: ' + res); }); }); * */ export interface PasswordReturnValue { complexity: (password: string, callback: (isComplex: boolean) => void) => boolean; check: (hashedPassword: string, callback: (err?: Error | null, isOk?: boolean) => void) => void; hash: (salt: string | null, iterations: number | null, callback: (err?: Error | null, hash?: string) => void) => void; } export declare function password(pw: string): PasswordReturnValue; //# sourceMappingURL=password.d.ts.map