Created
January 18, 2013 18:36
-
-
Save 46bit/4567048 to your computer and use it in GitHub Desktop.
Generate some SecureRandom data with a simple command. Handy when you don't want to run off to a CLI or dive into messy libs.
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
#!/usr/bin/env ruby | |
require "securerandom" | |
length = 24 | |
if ARGV[0] | |
length = ARGV[0].to_i | |
end | |
puts SecureRandom.base64(length) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment