add test/b32.ml; no need to re-pad in B32.decode

This commit is contained in:
swrup 2026-02-07 20:29:35 +01:00
parent c9842f5cc1
commit b741692018
4 changed files with 24 additions and 28 deletions

View file

@ -29,10 +29,6 @@ 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