Skip to content

Instantly share code, notes, and snippets.

@becojo
Created March 28, 2015 17:50
Show Gist options
  • Select an option

  • Save becojo/3aabd5fdf882bc6861fa to your computer and use it in GitHub Desktop.

Select an option

Save becojo/3aabd5fdf882bc6861fa to your computer and use it in GitHub Desktop.
hexdecoder
#!/usr/bin/env ruby
require 'canal'
if ARGV.empty?
puts %q{usage: hexdump [hex hex hex ...]}
else
puts ARGV.map(&canal.chars
.each_slice(2)
.to_a
.reverse
.map(&canal.join
.to_i(16)
.chr)
.join)
.join
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment