hash: use of_raw_string_opt

This commit is contained in:
swrup 2026-02-10 16:47:08 +01:00
parent 64ff6f7eb4
commit 5ccf9f34e7
5 changed files with 43 additions and 30 deletions

View file

@ -29,6 +29,10 @@ let decode s =
| c -> c)
s
in
(* restore padding for base32 lib *)
let n = 8 - (String.length s mod 8) in
let pad = String.make n '=' in
let s = s ^ pad in
match Base32.decode ~alphabet ~off:0 ~len:(String.length s) s with
| Error (`Msg e) -> Error e
| Ok v -> Ok v