crypto#pbkdf2 TypeScript Examples

The following examples show how to use crypto#pbkdf2. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: node-crypto.ts    From mtcute with GNU Lesser General Public License v3.0 6 votes vote down vote up
pbkdf2(
        password: Buffer,
        salt: Buffer,
        iterations: number
    ): MaybeAsync<Buffer> {
        return new Promise((resolve, reject) =>
            pbkdf2(
                password,
                salt,
                iterations,
                64,
                'sha512',
                (err: Error | null, buf: Buffer) =>
                    err !== null ? reject(err) : resolve(buf)
            )
        )
    }
Example #2
Source File: crypto.test.ts    From worktop with MIT License 5 votes vote down vote up
PBKDF2 = suite('PBKDF2', {
	native: promisify(pbkdf2)
})