mirror of
https://github.com/logos-storage/multicodec.git
synced 2026-01-02 13:33:10 +00:00
Add reserved code range for private use by applications (#191)
See GH/multiformats/multicodec#158. Changes are analogous to those proposed in GH/multiformats/multicodec#159.
This commit is contained in:
parent
ad0c435aa8
commit
e0e95825a0
11
README.md
11
README.md
@ -15,6 +15,7 @@
|
||||
- [Multicodec table](#multicodec-table)
|
||||
- [Adding new multicodecs to the table](#adding-new-multicodecs-to-the-table)
|
||||
- [Implementations](#implementations)
|
||||
- [Reserved Code Ranges](#reserved-code-ranges)
|
||||
- [FAQ](#faq)
|
||||
- [Contribute](#contribute)
|
||||
- [License](#license)
|
||||
@ -62,6 +63,16 @@ The `validate.py` script can be used to validate the table once it's edited.
|
||||
- [Ruby](https://github.com/sleeplessbyte/ruby-multicodec)
|
||||
- [Add yours today!](https://github.com/multiformats/multicodec/edit/master/table.csv)
|
||||
|
||||
## Reserved Code Ranges
|
||||
|
||||
The following code ranges have special meaning and may only have meanings assigned to as specified in their description:
|
||||
|
||||
### Private Use Area
|
||||
|
||||
*Range*: `0x300000 – 0x3FFFFF`
|
||||
|
||||
Codes in this range are reserved for internal use by applications and will never be assigned any meaning as part of the Multicodec specification.
|
||||
|
||||
## FAQ
|
||||
|
||||
> Why varints?
|
||||
|
||||
@ -72,6 +72,12 @@ def check(fname='table.csv'):
|
||||
)
|
||||
else:
|
||||
codes[code] = name
|
||||
|
||||
# Reserved Code Range: Private Use Area – Do not permit any codes in this range
|
||||
if code in range(0x300000, 0x400000):
|
||||
raise CheckError(
|
||||
f"found code in Private Use Area: {hex(code)} with name '{name}'"
|
||||
)
|
||||
except CheckError as e:
|
||||
success = False
|
||||
print(f"row {line}: {e}", file=sys.stderr)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user