1 USING: arrays combinators.lib io io.streams.string
2 kernel math math.parser namespaces prettyprint
3 sequences splitting strings ;
9 "Length: " write dup unparse write ", " write >hex write "h" write nl ;
11 : offset. ( lineno -- )
12 16 * >hex 8 CHAR: 0 pad-left write "h: " write ;
15 >hex 2 CHAR: 0 pad-left write ;
19 dup [ h-pad. " " write ] each
20 16 over length - 3 * CHAR: \s <string> write
21 [ dup printable? [ drop CHAR: . ] unless write1 ] each
25 : hexdump ( seq -- str )
28 16 <sliced-groups> [ line. ] each-index