kythe.io@v0.0.68-0.20240422202219-7225dbc01741/third_party/ocaml_b64/b64.mli (about) 1 (* 2 * Copyright (c) 2006-2009 Citrix Systems Inc. 3 * Copyright (c) 2010 Thomas Gazagnaire <thomas@gazagnaire.com> 4 * Copyright (c) 2014 Anil Madhavapeddy <anil@recoil.org> 5 * 6 * Permission to use, copy, modify, and distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 * 18 *) 19 20 (** Base64 is a group of similar binary-to-text encoding schemes that represent 21 binary data in an ASCII string format by translating it into a radix-64 22 representation. It is specified in RFC 4648. *) 23 24 (** A 64-character string specifying the regular Base64 alphabet. *) 25 val default_alphabet : string 26 27 (** A 64-character string specifying the URI- and filename-safe Base64 28 alphabet. *) 29 val uri_safe_alphabet : string 30 31 (** [decode s] decodes the string [s] that is encoded in base64 format. 32 Will leave trailing NULLs on the string, padding it out to a multiple 33 of 3 characters. *) 34 val decode : ?alphabet:string -> string -> string 35 36 (** [encode s] encodes the string [s] into base64. If [pad] is false, 37 no trailing padding is added. *) 38 val encode : ?pad:bool -> ?alphabet:string -> string -> string