bytes2hex.rb 187 B

12345678910111213
  1. #!/usr/bin/ruby
  2. # Stephen Paul Weber
  3. # For use with mnmonicode
  4. # ISC license
  5. arr = []
  6. str = ""
  7. inarr = STDIN.read.split(//)
  8. inarr.each do |i|
  9. print ("%x" % i[0]).rjust(2,'0')
  10. end
  11. puts