Module Http.Base64

Base64 codec.

Codecs Base64 according to RFC 4684.

val encode : ?⁠url:bool -> string -> string

encode s is the base64 (or base64url if url is true) encoding of s .

val decode : ?⁠url:bool -> string -> (string, int) Stdlib.result

decode s is the base64 (or base64url if url is true) decode of s. In case of error the integer indicates:

  • Either the byte index of the error for an invalid alphabet character error
  • Or the length of the string if the string length is not a multiple of 4