6 ms·
Good idea! Your downside is a major concern, but it would take all of 5 minutes to patch sha256sum to have a new output format, and another 3 months to have a
by wegs 6y ago
Good idea!
Your downside is a major concern, but it would take all of 5 minutes to patch sha256sum to have a new output format, and another 3 months to have a PR approved. Ditto for most libraries, except where written into standards (and I'm not sure if that's anywhere). I'd expect Python 3.9 to not be a problem either. So it's not a big deal to address the concern.
If you want to do this well, though, the trick would be to come up with a human-friendly format. You can't use both '0' and 'O.' You can't use '1,' 'l,' and 'I.' Invest the time to do HCI work.
And, ideally, you'd have some form of internal check-summing, so you can easily flag most typos.
Performance is NOT a concern. Some folks here mentioned the some encoding formats are table lookups. In most cases, generating or verifying a cryptographically-secure hash is many orders of magnitude slower than an encode/decode of the key into any format. And if you're not generating/verifying, in most cases, it doesn't make any sense to encode/decode (just pass around the encoded key).
- marton78 6y agoThe human friendly format you're suggesting is Douglas Crockford' Base 32 encoding.
- dlkinney 6y agoI disagree that his encoding is friendly. I understand the compromises he made in order to make it less ambiguous, but regular users come across hashes sometimes, and unless you know it's his encoding, they're (often) smart enough to know that some characters look like others. So, when they go to recite the encoded value, they're still going to struggle "is that a 0 or an O?" etc. We may know it doesn't make a difference, but someone who doesn't know it's explicitly his encoding (and the parameters he transposes) is still going to get hung up. Lastly, the removal of "u" only prevents 1.5 offensive words from showing up, but I guess he chose it because he had to get rid of some letter to make it base32. I think a base ~32 by removing all ambiguous characters and adding a non-separator punctuation mark would be ideal, frankly. If we're worried about swear words then also remove the vowels and add 4 more punctuation mark. IMHO
- wegs 6y agoThat's a !@#$ good idea for avoiding swear words :)