let bytes = randBytes (keySize / 8)\r
Convert.ToBase64String bytes |> WebUtility.UrlEncode\r
\r
+// TODO: return a Result<string, EncryptError>\r
let encrypt (key : Key) (name : string) : string =\r
let keyAsBytes = WebUtility.UrlDecode key |> Convert.FromBase64String\r
let iv = randBytes (keySize / 8)\r
stream.Read (result, iv.Length + hash.Length, int stream.Length) |> ignore\r
"1" + Convert.ToBase64String result |> WebUtility.UrlEncode\r
\r
+// TODO: return a Result<string, DecryptError>\r
let decrypt (key : Key) (cipher : string) (urlDecode : bool) : string =\r
let version = cipher.Substring (0, 1) |> int\r
if version <> 1 then\r