Created
August 5, 2019 21:52
-
-
Save deevis/ded145e4c3fa3e493530e1f1a7bd2bb0 to your computer and use it in GitHub Desktop.
Takes a byte[] and a width to set number of display columns and dumps the bytes out in a grid
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
decdump = ->(bytes,width) {bytes.each_with_index{|b,i| print " [#{i.to_s.rjust(3,' ')}] " | |
if i%width==0; print "#{b.to_s.rjust(3,' ')} "; puts "" if (i+1) % width == 0};nil} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
decdump.call(bytes, 8)