Javability (Java, Zaurus, Linux, Live) by Jean-Marc Autexier, Saarland/Germany
cat /dev/www | egrep 'Java|Linux|Zaurus|ITnews|Live' > blog

10.2.05 22:17 0xCAFEFEED, 0xDECAFBAD, 0xDEADBEAF ... ( , , , )

Once upon a time, when people did count bits and bytes, and protocols where a long sequence of bytes (ex ASN.1) and not textual (ex XML), developers added magic byte sequences for easier debugging of protocols.

History: C was very common in those days, and a common way of representing numbers in C is hexadecimal notation (For you poor Java guys out there who never saw a hexadecimal number: "Break a byte into two groups of 4 bits each: nnnn nnnn. Each group is called a nibble. A nibble with all low bits, 0000, is equal to 0. With all of its bits turned on, 1111, a nibble has a value of 15 (8 + 4 + 2 + 1). Thus, we are dealing with the 16 values from 0 through 15, and a base of 16. Just use digits for 0 through 9, and A through F for 10 through 15" (source).

As developers are funny people, they tried to build words from the 6 available letters. Adding those words between packets of your protocols made it both easy and funny for humans to read.

Here are few words I remember: DEADBEAF, DECAFBAD, CAFEFEED.

Which other words do you know build with A, B, C, D, E and F?

posted by Jean-Marc Autexier | 4 comments | Permalink | Send to Friends | Google it!
Comments:
From a colegue: 0xAFFE (German for ape), 0xDEAF
 
From one of the "poor Java guys out there": every valid Java class file must begin with 0xCAFEBABE
 
Ruurd Pels (ruurd) has few more samples in his blog entry lol: hex fun. Here is the list:
0xbaadf00d, 0xbaaadade, 0xdeadd00d, 0xdeafd00d, 0xfeedf00d, 0xbaaaaaad, 0xfeedbeef, 0xdeadface, 0xdeadc0de, 0xdeadd0d0, 0xf00dface, 0xfee1900d (feelgood), 0xc001c0de (coolcode)
 
Ruurd Pels (ruurd) has few more samples in his blog entry lol: hex fun. Here is the list:
0xbaadf00d, 0xbaaadade, 0xdeadd00d, 0xdeafd00d, 0xfeedf00d, 0xbaaaaaad, 0xfeedbeef, 0xdeadface, 0xdeadc0de, 0xdeadd0d0, 0xf00dface, 0xfee1900d (feelgood), 0xc001c0de (coolcode)
 

Kommentar veröffentlichen
Subscribe

Locations of visitors to this page
selected blogs
ressources
Security
Unsorted
Fun
Free&Open Software
archives
This is a personal web page. Things said here do not represent the position of my employer.
RSS icons by: FastIcon.com