2
0
mirror of synced 2025-02-24 20:18:07 +00:00

10 lines
371 B
JavaScript

"use strict";
import { pbkdf2Sync as _pbkdf2 } from "crypto";
import { arrayify, hexlify } from "@ethersproject/bytes";
function bufferify(value) {
return Buffer.from(arrayify(value));
}
export function pbkdf2(password, salt, iterations, keylen, hashAlgorithm) {
return hexlify(_pbkdf2(bufferify(password), bufferify(salt), iterations, keylen, hashAlgorithm));
}