nitlix-crypto
Version:
😍 Another starting collection of hashing, salting and other encryption tools 🚀 for the back-end side of the web.
13 lines (12 loc) • 471 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const node_crypto_1 = __importDefault(require("node:crypto"));
function default_1(string, method = "sha256") {
let hash = node_crypto_1.default.createHash(method);
hash.update(string);
return hash.digest("hex");
}