Last active
December 26, 2015 09:49
-
-
Save ctcherry/7132168 to your computer and use it in GitHub Desktop.
Very complicated way to print out "Hello, World!"
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' | |
require 'base64' | |
require 'stringio' | |
data = StringIO.new(Base64.decode64(DATA.read)) | |
byte_hashes = [] | |
while d = data.read(16) | |
byte_hashes << d.unpack('H*').first | |
end | |
byte_hashes.each do |needle_hash| | |
begin | |
random_byte = [Kernel.rand(255)].pack("C*") | |
random_byte_hash = Digest::MD5.hexdigest(random_byte) | |
end until needle_hash == random_byte_hash | |
print random_byte | |
end | |
__END__ | |
wdn1D4aCWhojAuwkScFxluFnF5fFLhX3YzgLRehB7DItuV6OGpJnt6EYhVay | |
ATszLblejhqSZ7ehGIVWsgE7M9lWeXUhNKLZ62Hb17kcS8zAy18PzyOas9nB | |
/NMf/x78chXunH2dwinSkhpA6JnsX2HpwG6pqFpQiKSZ32RY0nbZVnl1ITSi | |
2eth29e5HEvMS0OwruNWJM2VuRAYmz3CMS25Xo4akme3oRiFVrIBOzOCd+CR | |
DXUBlbRIeXYW4JGtkDPg4wXyR8DDyA0MeEjIsw== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment