aboutsummaryrefslogtreecommitdiff
path: root/spec/intro
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2023-11-09 10:48:14 -0500
committerNick Mathewson <nickm@torproject.org>2023-11-09 10:48:14 -0500
commit19f769c7868305b006ce9db8d5a27e0e58d5e62c (patch)
treec71c3b1b8a308d26344bfa7f6cbdfa64b9a2a749 /spec/intro
parent0df02187826397e83239a70a29c8af0866e5a53d (diff)
downloadtorspec-19f769c7868305b006ce9db8d5a27e0e58d5e62c.tar.gz
torspec-19f769c7868305b006ce9db8d5a27e0e58d5e62c.zip
Add binascii encodings to conventions.md
Diffstat (limited to 'spec/intro')
-rw-r--r--spec/intro/conventions.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/intro/conventions.md b/spec/intro/conventions.md
index e474c3a..8a92521 100644
--- a/spec/intro/conventions.md
+++ b/spec/intro/conventions.md
@@ -58,6 +58,37 @@ in big-endian ("network") order.
> it is the byte 0x00, the byte 0x00, the byte 0x12, and the byte 0x34.
> (\[00 00 12 34\]).
+## Binary-as-text encodings {#binascii}
+
+When we refer to "base64", "base32", or "base16",
+we mean the encodings described in
+[RFC 4648](https://datatracker.ietf.org/doc/html/rfc4648),
+with the following notes:
+
+- In base32, we never insert linefeeds in base32,
+ and we omit trailing `=` padding characters.
+- In base64,
+ we _sometimes_ omit trailing `=` padding characters,
+ and we do not insert linefeeds unless explicitly noted.
+- We do not insert any other whitespace,
+ except as specifically noted.
+
+Base 16 and base 32 are case-insensitive.
+Unless otherwise stated,
+implementations should accept any cases,
+and should produce a single uniform case.
+
+We sometimes refer to base16 as "hex" or "hexadecimal".
+
+> Note that as of 2023, in some places, the specs are not always
+> explicit about:
+>
+> - which base64 strings are multiline
+> - which base32 strings and base16 strings
+> should be generated in what case.
+>
+> This is something we should correct.
+
## Notation {#notation}
### Operations on byte strings {#ops}