Explorar o código

added bytes2hex

Stephen Paul Weber %!s(int64=17) %!d(string=hai) anos
pai
achega
b03491fd28
Modificáronse 1 ficheiros con 13 adicións e 0 borrados
  1. 13 0
      bytes2hex.rb

+ 13 - 0
bytes2hex.rb

@@ -0,0 +1,13 @@
+#!/usr/bin/ruby
+
+# Stephen Paul Weber
+# For use with mnmonicode
+# ISC license
+
+arr = []
+str = ""
+inarr = STDIN.read.split(//)
+inarr.each do |i|
+	print ("%x" % i[0]).rjust(2,'0')
+end
+puts