Template:HexRow

From OniGalore
Revision as of 14:42, 17 November 2006 by Geyser (talk | contribs) (enjoy)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
0x00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 °°°°°°°°°°°°°°°°


Here's an all-ASCII alternative to GIF/PNG snapshots of hex data.

Usage

The following input :

{|border=1 cellspacing=0 style="font-family:courier"
 <nowiki>{{HexRow
|0x00
|01|51|02|00|01|00|00|06|AD|DE|AD|DE|AD|DE|AD|DE
|FF|FF|FF|FF|FF|FF|FF|FF|00|00|00|00|00|00|00|00
|00|00|00|00|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF
|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00
|°who°needs°this°
}}

produces the following output :

0x00 01 51 02 00 01 00 00 06 AD DE AD DE AD DE AD DE °who°needs°this°

There are 65 arguments; they are not named, but they line up nicely in a 16x4 lattice.

  • The first argument is the data's offset (default is 0x00, maybe it should be blank).
  • The next 16 arguments are the 16 hex bytes.
  • Then you have the RGB components of every byte's background :
    • 16 "red" bytes
    • 16 "green" bytes
    • 16 "blue" bytes
  • Finally, you can add an ASCII translation if you so wish.
    • Most of the time it's actually irrelevant; I'd systematically show all non-printable chars as °.
    • If all 16 chars are non-printable, leave the last argument blank (the default value is °°°°°°°°°°°°°°°°)