This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require('crypto') | |
function generatePassword(password, options = {}) { | |
const { iterations = 1000, keylen = 20, digest = 'sha1', saltSize = 24 } = options | |
const salt = crypto.randomBytes(saltSize).toString('hex') | |
const key = crypto.pbkdf2Sync(password, salt, iterations, keylen, digest).toString('hex') | |
return { | |
iterations, | |
salt, | |
key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateCUIL(dni, type) { | |
if (dni.toString().length < 7) return false; | |
let xy = 30; | |
if (type === 'f') { | |
xy = 27; | |
} else if(type === 'm') { | |
xy = 20; | |
} |