Commit 038a6a4b authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Remove trailing "=" from JS version of sha256_b64

parent f45ba5fd
......@@ -30,8 +30,13 @@ let sha256_hex x =
[| sha256 x |] |> Js.to_string
let sha256_b64 x =
Js.Unsafe.meth_call sjcl "codec.base64.fromBits"
[| sha256 x |] |> Js.to_string
let raw =
Js.Unsafe.meth_call sjcl "codec.base64.fromBits"
[| sha256 x |] |> Js.to_string
in
match (try Some (String.index raw '=') with Not_found -> None) with
| Some i -> String.sub raw 0 i
| None -> raw
let b64_encode_compact x = assert false
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment