in reply to Re^4: Decoding Base32
in thread Decoding Base32

Assuming udecode_base32 should be decode_base32, why are you passing a hex string to it?

Update: Ah, you want to convert the SHA to hex, but that's now what you're doing. Fix:

print "SHA1: " . unpack('H*', decode_base32($urn_decode)) . "\n";

Replies are listed 'Best First'.
Re^6: Decoding Base32
by Anonymous Monk on Apr 19, 2010 at 16:49 UTC

    You are correct, I had meant decode_base32. And, yes, I'm trying to get back to hex as I need to be able to verify the hashes of downloads.

    I knew this must be fairly trivial as I appear to be the only one needing help. I should have caught my encapsulation was incorrect. Apparently decode_base32 still expects all lowercase characters; at least my version does.

    All that said, I'm in good working order now. I really appreciate your time and help ikegami.

      Acceptance of uc was added to 0.03. To have older versions accept uc:
      print "SHA1: " . unpack('H*', decode_base32(lc($urn_decode))) . "\n";