Sha256: 185e068303dc28f473c8402830bdee4706267b9d626833564f0ad73c8f91b7b3

Contents?: true

Size: 263 Bytes

Versions: 2

Compression:

Stored size: 263 Bytes

Contents

require 'digest/sha1'

def hash_fn(str)
  Digest::SHA1.hexdigest str
end

def salted_hash(str,salt)
  100.times do
    str = hash_fn(str+salt)
  end
  str
end

ALPHA = ('A'..'Z').to_a + ('a'..'z').to_a

def generate_salt(n=30)
  (1..n).map{ALPHA.sample}.join
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
salty-0.0.2 lib/salty.rb
salty-0.0.1 lib/salty.rb