That would be an intelligent first guess ...

The code used is the code posted above. The only modifications I've done are attempting to add (and remove) lc and unpack functions within the decode_base32 to condition the data properly. I am not completely confident in my understanding of unpack, but one such attempt looked like:

print "SHA1: " . udecode_base32(unpack('H32', $urn_decode)) . "\n";

As for example data, I simply grabbed a SHA-1 of a zip file using md5deep. That was converted to base32 using both this script and BitCollider 1 provided by bitzi.com.

SHA-1: 58d18761f662f8cb4cf26de2f82f1b5c6e9a9857
SHA-1 Base32: LDIYOYPWML4MWTHSNXRPQLY3LRXJVGCX

1 http://bitzi.com/bitcollider

In reply to Re^4: Decoding Base32 by Anonymous Monk
in thread Decoding Base32 by Cynric

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.