aboutsummaryrefslogtreecommitdiff
path: root/misc/file_to_bytes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'misc/file_to_bytes.rb')
-rwxr-xr-xmisc/file_to_bytes.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/misc/file_to_bytes.rb b/misc/file_to_bytes.rb
new file mode 100755
index 000000000000..047c91054f5e
--- /dev/null
+++ b/misc/file_to_bytes.rb
@@ -0,0 +1,5 @@
+#!/usr/bin/env ruby
+
+lst = (ARGV.empty? ? STDIN.read : IO.binread(ARGV[0])).bytes.map {|_| '0x%02X' % _ }
+puts lst.size
+puts lst.join(', ')