Hex Encode

    $ printf Man | od -t 'x1'         
    0000000    4d  61  6e                                                    
    0000003

Of course many such implementations have been created over the years, and it can be good practice to write yet another, but such encoders mostly strike me as not being very hex-like. I mean, where are the hexagrams?

    $ printf Man | perl hex3.pl 
    ䷓䷖䷅䷮

Link

This is a base64 encoding as there are 64 hexagrams, which are a trifle difficult to read on this here terminal, but that's neither here nor there. One advantage is that this helps automate (doubtless incorrect) readings based on the hex encoding. Several carefully cherry picked inputs may suffice. ("Man" was used following the Wikipedia article on base64 to help avoid at least some of the more obvious bugs.)

    $ whatchar `printf Man | perl hex3.pl`
    [䷓] So U+4DD3 HEXAGRAM FOR CONTEMPLATION
    [䷖] So U+4DD6 HEXAGRAM FOR SPLITTING APART
    [䷅] So U+4DC5 HEXAGRAM FOR CONFLICT
    [䷮] So U+4DEE HEXAGRAM FOR OPPRESSION
    $ whatchar `printf Rat | perl hex3.pl`
    [䷔] So U+4DD4 HEXAGRAM FOR BITING THROUGH
    [䷦] So U+4DE6 HEXAGRAM FOR OBSTRUCTION
    [䷅] So U+4DC5 HEXAGRAM FOR CONFLICT
    [䷴] So U+4DF4 HEXAGRAM FOR DEVELOPMENT
    $ whatchar `printf Adz | perl hex3.pl`
    [䷐] So U+4DD0 HEXAGRAM FOR FOLLOWING
    [䷖] So U+4DD6 HEXAGRAM FOR SPLITTING APART
    [䷑] So U+4DD1 HEXAGRAM FOR WORK ON THE DECAYED
    [䷺] So U+4DFA HEXAGRAM FOR DISPERSION

Productive uses for this? Look! What ever could that be!


Source