Skip to content

Instantly share code, notes, and snippets.

@ozouai
Last active May 8, 2017 04:44
Show Gist options
  • Save ozouai/24fdaedfbd89a811a69f9209485a0665 to your computer and use it in GitHub Desktop.
Save ozouai/24fdaedfbd89a811a69f9209485a0665 to your computer and use it in GitHub Desktop.
Node SecurePIN
var securePin = require("secure-pin");
securePin.generatePin(4, function(pin) {
console.log(pin);
});
var securePin = require("secure-pin");
var pin = securePin.generatePinSync(4);
console.log(pin);
var securePin = require("secure-pin");
var charSet = new securePin.CharSet();
charSet.addLowerCaseAlpha().addUpperCaseAlpha().addNumeric().randomize();
securePin.generateString(15, charSet, function(str) {
console.log(str);
});
var securePin = require("secure-pin");
var charSet = new securePin.CharSet();
charSet.addLowerCaseAlpha().addUpperCaseAlpha().addNumeric().randomize();
var str = securePin.generateStringSync(10, charSet);
console.log(str);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment