summaryrefslogtreecommitdiff
path: root/src/id.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/id.rs')
-rw-r--r--src/id.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/id.rs b/src/id.rs
index 5ae61e9..aec7a67 100644
--- a/src/id.rs
+++ b/src/id.rs
@@ -7,7 +7,8 @@ use std::fmt;
// * Do not require escaping in hostnames
// * Are unique up to case conversion
// * Are relatively unlikely to contain cursewords
-// * Are relatively unlikely to contain visually similar characters in most typefaces
+// * Are relatively unlikely to contain visually similar characters in most
+// typefaces
// * Are not sequential
//
// This leaves 23 ASCII characters, or about 4.52 bits of entropy per character
@@ -17,16 +18,17 @@ const ALPHABET: [char; 23] = [
't', 'w', 'x', 'y',
];
-// Pick enough characters per ID to make accidental collisions "acceptably" unlikely
-// without also making them _too_ unwieldy. This gives a fraction under 68 bits per ID.
+// Pick enough characters per ID to make accidental collisions "acceptably"
+// unlikely without also making them _too_ unwieldy. This gives a fraction under
+// 68 bits per ID.
const ID_SIZE: usize = 15;
// Intended to be wrapped in a newtype that provides both type-based separation
// from other identifier types, and a unique prefix to allow the intended type
// of an ID to be determined by eyeball when debugging.
//
-// By convention, the prefix should be UPPERCASE - note that the alphabet for this
-// is entirely lowercase.
+// By convention, the prefix should be UPPERCASE - note that the alphabet for
+// this is entirely lowercase.
#[derive(
Clone,
Debug,