package base64
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=b3f5ce301aa72c7032ef90be2332d72ff3962922c00ee2aec6bcade187a2f59b
sha512=82148a1fefec9493aaeac032c8d46b9548369d7fd90a57865e009a32c8a0eef950f0f8dbb52b74bb46880a590a0b49f2daa7ab4857233734aee8e383f5a164ec
doc/base64.rfc2045/Base64_rfc2045/index.html
Module Base64_rfc2045Source
Decode
A 64-character string specifying the regular Base64 alphabet.
The type for decoders.
The type for input sources. With a `Manual source the client must provide input with src.
src d s j l provides d with l bytes to read, starting at j in s. This byte range is read by calls to decode with d until `Await is returned. To signal the end of input, call the function with l = 0.
decode d is:
`Awaitifdhas a`Manualinput source and awaits for more input. The client must usesrcto provide it.`Endif the end of input was reached`Malformed bytesif thebytessequence is malformed according to the decoded base64 encoding scheme. If you are interested in a best-effort decoding, you can still continue to decode after an error until the decode synchronizes again on valid bytes.`Flush dataif adatasequence value was decoded.`Wrong_paddingif decoder retrieve a wrong padding at the end of the input.
Note. Repeated invocation always eventually returns `End, even in case of errors.
decoder_byte_count d is the number of characters already decoded on d (included malformed ones). This is the last decode's end output offset counting from beginning of the stream.
decoder_dangerous d returns true if encoded input does not respect the 80-columns rule. If your are interested in a best-effort decoding you can still continue to decode even if decoder_dangerous d returns true. Nothing grow automatically internally in this state.
The type for output destinations. With a `Manual destination the client must provide output storage with dst.
The type for Base64 (RFC2045) encoder.
encoder dst is an encoder for Base64 (RFC2045) that outputs to dst.
encode e v: is
`Partialiffehas a`Manualdestination and needs more output storage. The client must usedstto provide a new buffer and then callencodewith`Awaituntil`Okis returned.`Okwhen the encoder is ready to encode a new`Charor`End
For `Manual destination, encoding `End always return `Partial, the client should continue as usual with `Await until `Ok is returned at which point dst_rem encoder is guaranteed to be the size of the last provided buffer (i.e. nothing was written).
Raises. Invalid_argument if a `Char or `End is encoded after a `Partial encode.