lib/salty.rb in salty-0.0.5 vs lib/salty.rb in salty-0.0.6
- old
+ new
@@ -2,10 +2,11 @@
SALT_LENGTH=30
ALPHA = ('A'..'Z').to_a + ('a'..'z').to_a + ('0'..'9').to_a
def hash_fn(str)
- Digest::SHA1.hexdigest str
+ sha512 = Digest::SHA2.new(512)
+ sha512.hexdigest(str)
end
def generate_salt
(1..SALT_LENGTH).map{ALPHA.sample}.join
end