Created
October 3, 2016 15:07
-
-
Save msg7086/456b25de5bd209ebb98836b8214bd62a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
require 'digest' | |
md5 = '3bed22f7f496e84b035a996522baa7594c27c7e5718a78bfddf9012904b70eb755d67f90c8de149ead7ee674b024f38c216642030c2d54cb1dd657dd66342c99c239f3c31fd399fc052a9b7861f2073d2b9f47811dd77fd544d570c34bf5f349d110389979571714694a5054238465ca38ba26c25fb1a32b4d0a3b93666b09b3' | |
prefix = Digest::MD5.hexdigest 'v2ex' | |
str = '' | |
md5.scan(/.{32}/) { |m| str += [*'0'..'9',*'A'..'Z',*'a'..'z'].find { |s| Digest::MD5.hexdigest(prefix + str + s + Digest::MD5.hexdigest(str + s)) == m } } | |
puts str #=> csdaixie |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment