Tag Archives: random password

Ruby – Generate Random Password

0
Filed under ruby
Tagged as , , , , , ,

Author: slac3dork
Site: http://snippet.c0de.me
Summary: Generate eight characters random password using Active Support. Active Support is utility classes and standard library extensions from Rails. The preferred method of installing Active Support is through its GEM file. You’ll need to have install RubyGems first (http://docs.rubygems.org/)

#!/usr/bin/env ruby

#  _________      .__       .____   _______
# /   _____/ ____ |__|_____ |    |  \   _  \    ____
# \_____  \ /    \|  \____ \|    |  /  /_\  \  / ___\
# /        \   |  \  |  |_> >    |__\  \_/   \/ /_/  >
#/_______  /___|  /__|   __/|_______ \_____  /\___  /
#        \/     \/   |__|           \/     \//_____/
# http://snippet.c0de.me
# slac3dork[at]gmail[dot]com

require 'rubygems'
require 'active_support'

passwd = ActiveSupport::SecureRandom.base64(8)
puts "Random Password: " + passwd


ruby,code,code,snippet