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 | |
# Ruby script to generate SSHA (Good for LDAP) | |
require 'digest/sha1' | |
require 'base64' | |
# The output in hash will never have trailing whitespace, removed .chomp! | |
hash = Base64.encode64(Digest::SHA1.digest(#{pass}#{salt}#{salt})) | |
# Use string interpolation, no need to add \n puts does this for you | |
puts "userPassword: #{hash}" |