SHA256 checksums

Anders F Björklund afb at macports.org
Mon Oct 25 01:31:29 PDT 2010


I think the main objection to sha256 checksums was
that they were "too long", even though one sha256
is shorter than two as in both of sha1 and rmd160...

But one way to make it "shorter" is to use base32
rather than base16 for encoding the digest string ?
(the end bits are of course the same, either way)

base16: 0123456789abcdef (hex)

base32: 0123456789ABCDEFGHIJKLMNOPQRSTUV (base32hex)

md5 d41d8cd98f00b204e9800998ecf8427e
sha1 da39a3ee5e6b4b0d3255bfef95601890afd80709
sha256 SEOC8GKOVGE196NRUJ49IRTP4GJQSGF4CIDP6J54IMCHMU2IN1AG
sha256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

One could either have it tell by the string length,
or call the checksum something else - like "sha2" ?
I added a base32 encode/decode function to Pextlib.

The RFC 4648 standard demands padding with '=' chars,
but that wouldn't be necessary as the length is known
so those can be stripped off and added before decode ?

--anders




More information about the macports-dev mailing list