IOCCC image by Matt Zucker

The International Obfuscated C Code Contest

2024/stedolan - Best one liner

icon from MD5

Author:

To build:

    make all

To use:

    echo {10-hex-digits} | ./prog > out.pbm

Try:

    md5sum prog.c | ./prog | display -

Judges’ remarks:

There are no magic numbers in the program, and bits of the input map to pixels of the output in a regular way, yet it outputs a nice icon for itself, if given the MD5 hash of its own source. How?

Author’s remarks:

This program is a decoder for a very compact icon format, producing 80x80 pixel pbm images based on small bitmapped icons:

    echo faf6bdafe6 | ./prog | display -   # calendar
    echo f843928fe0 | ./prog | display -   # mail
    echo f0b42d0bd8 | ./prog | display -   # battery
    echo f39ce33bc0 | ./prog | display -   # 1
    echo f0aced1bc0 | ./prog | display -   # 2
    echo f1b4ed1bc0 | ./prog | display -   # 3
    echo 4010881098 | ./prog | display -   # ?
    echo c6018c7398 | ./prog | display -   # !
    echo de848d2c3c | ./prog | display -   # the tetrominos

NOTE: The use of | display - is optional. If omitted, just view the resulting output in a terminal with a small font size.

NOTE: Else if do not have ImageMagick’s display(1) tool installed the use pbm image viewing tool of your choice.

Effort has been made to reduce the size of the program text to a single longish line (135 characters, including newline). Regrettably, this left no space in which to store the program’s own icon, a picture of a computer screen displaying ‘C’.

Accordingly, the program’s icon is instead stored in the program’s MD5 hash:

    md5sum prog.c | ./prog | display -

NOTE: On machines without md5sum(1), try md5 or openssl md5 -r.

Notes

Inventory for 2024/stedolan

Primary files

Secondary files


Jump to: top