Created
January 13, 2015 14:14
-
-
Save coder36/6d3e84c22f1b4da386ce to your computer and use it in GitHub Desktop.
Hello World encoding to binary and back
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
| "Hello world".bytes.map { |b| b.to_s(2).rjust(8, '0') }.join.to_i(2).to_s(2).scan(/.+?(?=.{8}*\z)/).map {|s| s.to_i(2).chr}.join |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment