Random password generation with Ruby

Suppose we want to generate a random, robust and fairly secure password using Ruby then we create a "random_password" function that returns a password with 12 characters or if we want one with more or less we have to pass this value as a parameter.

First we define the range of characters allowed for the password

(more…)