You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-14Lines changed: 16 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,13 +21,13 @@
21
21
***name** - a series of any number of labels (including 0) separated by label separators, e.g. `abc.eth`.
22
22
23
23
**Names**
24
-
***normalized name** - a name that is in normalized form according to the ENS Normalization Standard. This means `name == ens_normalize(name)`. A normalized name always contains at least 1 label. All labels in a normalized name always contain a sequence of at least 1 character.
24
+
***normalized name** - a name that is in normalized form according to the ENS Normalization Standard. This means `name == ens_normalize(name)`. A normalized name contains 0 or more labels. All labels in a normalized name always contain a sequence of at least 1 valid character. An empty string contains 0 labels and is a normalized name.
25
25
***normalizable name** - a name that is normalized or that can be converted into a normalized name using `ens_normalize`.
26
26
***beautiful name** - a name that is normalizable and is equal to itself when using `ens_beautify`. This means `name == ens_beautify(name)`. For all normalizable names `ens_normalize(ens_beautify(name)) == ens_normalize(name)`.
27
27
***disallowed name** - a name that is not normalizable. This means `ens_normalize(name)` raises a `DisallowedSequence`.
28
28
***curable name** - a name that is normalizable, or a name in the subset of disallowed names that can still be converted into a normalized name using `ens_cure`.
29
-
***empty name** - a name that is the empty string. An empty name is disallowed and not curable.
30
-
***namehash ready name** - a name that is ready for for use with the ENS `namehash` function. Only normalized and empty names are namehash ready. Empty names represent the ENS namespace root for use with the ENS `namehash` function. Using the ENS `namehash` function on any name that is not namehash ready will return a node that is unreachable by ENS client applications that use a proper implementation of `ens_normalize`.
29
+
***empty name** - a name that is the empty string. An empty string is a name with 0 labels. It is a *normalized name*.
30
+
***namehash ready name** - a name that is ready for for use with the ENS `namehash` function. Only normalized names are namehash ready. Empty names represent the ENS namespace root for use with the ENS `namehash` function. Using the ENS `namehash` function on any name that is not namehash ready will return a node that is unreachable by ENS client applications that use a proper implementation of `ens_normalize`.
31
31
32
32
**Sequences**
33
33
***unnormalized sequence** - a sequence from a name that is not in normalized form according to the ENS Normalization Standard.
@@ -119,14 +119,17 @@ ens_cure('Nick?.ETH')
119
119
# 'nick.eth'
120
120
# ZWJ and '?' are removed, no error is raised
121
121
122
-
# note: might still raise DisallowedSequence for certain names, which cannot be cured, e.g.
122
+
# note: might remove all characters from the input, which would result in an empty name
123
123
ens_cure('?')
124
-
#DisallowedSequence: No valid characters in name
125
-
# reason: '?' would have to be removed which would result in an empty name
124
+
#'' (empty string)
125
+
# reason: '?' is disallowed and no replacement can be suggested
126
126
127
-
ens_cure('0χх0.eth')
127
+
# note: might still raise DisallowedSequence for certain names, which cannot be cured, e.g.
128
+
ens_cure('0х0.eth')
128
129
# DisallowedSequence: Contains visually confusing characters from Cyrillic and Latin scripts
129
-
# reason: it is not clear which character should be removed ('χ' or 'х')
130
+
# reason: The "х" is actually a Cyrillic character that is visually confusing with the Latin "x".
131
+
# However, the "0"s are standard Latin digits and it is not clear which characters should be removed.
132
+
# They conflict with each other because it is not known if the user intended to use Cyrillic or Latin.
130
133
```
131
134
132
135
Get a beautiful name that is optimized for display:
@@ -275,12 +278,11 @@ Curable errors contain additional information about the disallowed sequence and
275
278
276
279
Disallowed name errors are not considered curable because it may be challenging to suggest a specific normalization suggestion that might resolve the problem.
277
280
278
-
|`DisallowedSequenceType`| General info |
279
-
| ------------------------- | ------------ |
280
-
|`EMPTY_NAME`| No valid characters in name |
281
-
|`NSM_REPEATED`| Contains a repeated non-spacing mark |
282
-
|`NSM_TOO_MANY`| Contains too many consecutive non-spacing marks |
283
-
|`CONF_WHOLE`| Contains visually confusing characters from {script1} and {script2} scripts |
281
+
|`DisallowedSequenceType`| General info | Explanation |
|`NSM_REPEATED`| Contains a repeated non-spacing mark | Non-spacing marks can be encoded as one codepoint with the preceding character, which makes it difficult to suggest a normalization suggestion |
284
+
|`NSM_TOO_MANY`| Contains too many consecutive non-spacing marks | Non-spacing marks can be encoded as one codepoint with the preceding character, which makes it difficult to suggest a normalization suggestion |
285
+
|`CONF_WHOLE`| Contains visually confusing characters from {script1} and {script2} scripts | Both characters are equally likely to be the correct character to use and a normalization suggestion cannot be provided |
0 commit comments