add comment for checksum in base48 encoding

This commit is contained in:
Arthur Breitman 2016-11-20 00:29:58 -08:00 committed by Grégoire Henry
parent ac7342a43d
commit 39ea223e5b

View File

@ -89,6 +89,7 @@ let sha256 s =
let computed_hash = hash#result in hash#wipe; let computed_hash = hash#result in hash#wipe;
computed_hash computed_hash
(* Prepend a 4 byte cryptographic checksum before encoding string s *)
let safe_encode ?alphabet s = let safe_encode ?alphabet s =
raw_encode ?alphabet (s ^ String.sub (sha256 (sha256 s)) 0 4) raw_encode ?alphabet (s ^ String.sub (sha256 (sha256 s)) 0 4)