Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There's a fair few of those out in the wild.

The magic number that identifies a java .class file is 0xCAFEBABE.




Here's another list. :P

< /usr/share/dict/words perl -ne 'print if m/^[abcdefilzsbtgo]*$/ && m/^........$/;' | perl -ne 'print if !(m/i/ && m/l/);' | tr 'ilzstgo' '1125790' | tr '[:lower:]' '[:upper:]' | perl -ne 'print "0x$_"' | column


Thanks. I found I needed a bit of help for rapid scanning, so:

< /usr/share/dict/words perl -ne 'next unless m/^[abcdefilzsbtgo]*$/ && m/^........$/; next unless !(m/i/ && m/l/); chomp; print "$_ "; $_ =~ tr/ilzstgo/1125790/; print "0x$_\n"' | column

This adds the original word to the left of the hex. It makes the list much more scannable.

Tweaking the dots to count 10 shows that there are apparently 33 choices for WEP codes, if you are so inclined. (Which of course you shouldn't be, but, well...) And, alas, there do not appear to be any 64-bit constants according to my dictionary, though there's enough 32-bit coices to have some fun with phrases ("collated catcalls", "sadistic sabotage", "fattiest feedbags", "besotted ascetics", etc.). And that's just the even 8-8 phrases, 9-7 has almost as many ("godless geodesics", "falsest statistic", 0x7a55e11edb00b1e5).


< /usr/share/dict/words perl -lne 'print "$_ 0x",tr/ilzstgo/1125790/r if m/^[abcdefilzsbtgo]{8}$/ && !(m/i/ && m/l/)' | column

Thank dhart for an introduction to the "< /file program" idiom that puts file first without resorting to cat, and for column for that matter. Neat. In return I'll offer perl's new /r flag which "returns" the result of tr// or s/// rather than some count.


There are a surprising number of those which could potentially be useful, like 0x0B501373, 0xCA11AB1E, and 0x5E77AB1E.


I'd end up wanting to spell it 0x0B501337.


And no code review jury would convict you. Now, if you start padding your arrays with 0xA5B35705, OSHA might get involved.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: