xref: /freebsd/contrib/libcbor/misc/file_to_bytes.rb (revision e1c4c8dd8d2d10b6104f06856a77bd5b4813a801)
1#!/usr/bin/env ruby
2
3lst = (ARGV.empty? ? STDIN.read : IO.binread(ARGV[0])).bytes.map {|_| '0x%02X' % _ }
4puts lst.size
5puts lst.join(', ')
6