def random_string(h=4)
chars = (Digest::MD5.hexdigest "#{DateTime.now.to_s}")
code = ''
length.times { code << chars[rand(chars.size)] }
code.upcase
end
chars = (Digest::MD5.hexdigest "#{DateTime.now.to_s}")
code = ''
length.times { code << chars[rand(chars.size)] }
code.upcase
end
Comments
Post a Comment