Generates strings using crypto.randomBytes(). Does not use any additional packages to mitigate dependency vulnerabilities.
npm install auth-gen
var authGen = require('auth-gen');
Generates a unique string from a provided length. Optionally you can provide a string of characters to use instead of the default.
authGen.uniqueStr(16) // -> t8yKHADypFe57KsU
authGen.uniqueStr(16, "abcde") // -> bbedeabaeadccead
Generates a three-part unique 32 byte id value using the uniqueStr function.
authGen.id() // -> DYYNZYdUBd-9c36jm5hL2-gRNbLBMPuZ
Generates a temporary password from a provided length using the uniqueStr function. Adds symbols to the list of valid characters.
authGen.password(16) // -> BrPXuAKqdWg?es=y