Skip to content

Instantly share code, notes, and snippets.

@zwily
Created November 5, 2010 02:45
Show Gist options
  • Save zwily/663574 to your computer and use it in GitHub Desktop.
Save zwily/663574 to your computer and use it in GitHub Desktop.
def hashed_bip_pw(pw)
seed = ''
4.times { seed << Kernel.rand(256).chr }
str = seed + pw
Digest.hexencode(seed + Digest::MD5.digest(seed + Digest::MD5.digest(str)))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment