summaryrefslogtreecommitdiff
path: root/static/inferno/man2/encoding.2
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
commit97d5c458cfa039d857301e1ca7d5af3beb37131d (patch)
treeb460cd850d0537eb71806ba30358840377b27688 /static/inferno/man2/encoding.2
parentb89dc2331a50c63f8b33272a5c4c61ab98abdaa3 (diff)
build: Better Build System
Diffstat (limited to 'static/inferno/man2/encoding.2')
-rw-r--r--static/inferno/man2/encoding.250
1 files changed, 50 insertions, 0 deletions
diff --git a/static/inferno/man2/encoding.2 b/static/inferno/man2/encoding.2
new file mode 100644
index 00000000..6dc5189f
--- /dev/null
+++ b/static/inferno/man2/encoding.2
@@ -0,0 +1,50 @@
+.TH ENCODING 2
+.SH NAME
+Encoding: enc, dec \- encoding and decoding of byte arrays as text
+.SH SYNOPSIS
+.EX
+include "encoding.m";
+base16 := load Encoding Encoding->BASE16PATH;
+base32 := load Encoding Encoding->BASE32PATH;
+base32a := load Encoding Encoding->BASE32APATH;
+base64 := load Encoding Encoding->BASE64PATH;
+
+enc: fn(a: array of byte): string;
+dec: fn(s: string): array of byte
+.EE
+.SH DESCRIPTION
+.B Encoding
+presents a common interface to several ways of encoding binary data (represented in arrays of bytes)
+as printable text, to be included in essentially textual data (such as XML) or
+sent through e-mail systems (as in MIME).
+.PP
+.B Enc
+returns a string with a textual encoding of the binary data in
+.IR a .
+.PP
+.B Dec
+returns an array of bytes containing the binary data encoded in
+.IR s .
+.PP
+Four encodings are provided, including all those defined by RFC3548;
+load the one required from the given path.
+.TP
+.B BASE16PATH
+Encode in base 16, representing each byte as a pair of hexadecimal digits, using upper-case letters (RFC3548).
+.TP
+.B BASE32PATH
+Encode in base 32, encoding 5 bits per character, using upper-case letters, digits `2' to `7', padded with `=', as per RFC3548.
+.TP
+.B BASE32APATH
+Alternative encoding in base 32, encoding 5 bits per character, using digits `2' to `7', letters (either case) except `l' and `o', not padded.
+.TP
+.B BASE64PATH
+Encode in base 64, encoding 6 bits per character, using upper- and lower-case letters, digits, `+' and `/',
+padded with `=' (RFC3548).
+.PP
+When decoding, white space and illegal characters are ignored;
+base 16 and base 32 decoders are case-insensitive.
+.SH SOURCE
+.B /appl/lib/encoding
+.SH SEE ALSO
+.IR convcs (2)