hash: use of_raw_string_opt
This commit is contained in:
parent
64ff6f7eb4
commit
5ccf9f34e7
5 changed files with 43 additions and 30 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue