Jump to content

Hex dump: Difference between revisions

m
Add links to task description.
(Added FreeBASIC)
m (Add links to task description.)
Line 1:
{{draft task}}
 
A [https[wp://en.wikipedia.org/wiki/Hex_dump |hex dump]] is a textual representation of bytes in a file, and ''hexdump'' is a command-line tool that can dump bytes from a file in a variety of formats, including [[wp:Hexadecimal|hexadecimal]], [[wp:Octal|octal]] and [[wp:ASCII|ASCII]].
 
[https://man.freebsd.org/cgi/man.cgi?query=hexdump hexdump]'s canonical format displays, on each line:
''hexdump'' is a command-line tool that can dump bytes from a file in a variety of formats, including hexadecimal, octal and ASCII.
 
hexdump's canonical format displays, on each line:
 
* a byte offset in hexadecimal,
* up to 16 bytes in hexadecimal, separated by spaces, with an extra space between the 8th and 9th byte,
* the same 16 bytes interpreted as ASCII characters, with non-printing and non-ascii characters replaced with a dot (<code>.</code>), surrounded by pipes (<code>|</code>).
 
The last line of output shows a final byte count, also in hexadecimal.
 
For example, the string "Rosetta Code is a programming chrestomathy site 😀." encoded in [[wp:UTF-16|UTF-16]] (little-endian - the first two bytes are the [[wp:Byte_order_mark|byte order mark]]), displayed in the canonical format is:
 
<pre>
147

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.