From 39ea223e5b0cba3e6b2096acce027dd133ae9466 Mon Sep 17 00:00:00 2001 From: Arthur Breitman Date: Sun, 20 Nov 2016 00:29:58 -0800 Subject: [PATCH] add comment for checksum in base48 encoding --- src/utils/base48.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/base48.ml b/src/utils/base48.ml index b5ab98861..59cde6d70 100644 --- a/src/utils/base48.ml +++ b/src/utils/base48.ml @@ -89,6 +89,7 @@ let sha256 s = let computed_hash = hash#result in hash#wipe; computed_hash +(* Prepend a 4 byte cryptographic checksum before encoding string s *) let safe_encode ?alphabet s = raw_encode ?alphabet (s ^ String.sub (sha256 (sha256 s)) 0 4)