-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text, raw varint, bytecode distinction #76
Comments
I ran into that same concern and added the following to the README. Does this help?
(if not, we need to improve the readme) When the table uses codes in the form 0x..., those codes are expected to appear in a binary (byte string) context as varints. Otherwise, the codes are "symbols".
NUL means the NUL character. Text encodings usually encode this as
Hm. Yes, we should consider escaping those quotes. This case is the same as NUL.
The table shows them as numbers. When encoded in a byte string, they must be
Nope. That's why we made this table.
As 0x84 is just a number, no (I'll comment on your other PR separately). |
This is indeed very confusing. I really don't understand what do you mean by symbol. If you check my #89, you will understand my problem. For example, multihash |
If you check the JS implementation here base-table.js#L11:
All of them are treated as |
The JS implementation is wrong, thanks for catching that: multiformats/js-multicodec#29
For example, binary is composed of two symbols 0 and 1 (or true and false). Bytes are defined to each be a string of 8 binary symbols but are also, themselves, symbols (there are 256 of them). Every character is also a symbol. On a computer, these symbols may be encoded into bits/bytes but there are often several ways to encode a single symbol into bits/bytes and the symbol exists apart from these encodings (an '1' on paper is a '1', not 0x31). |
In this case, the python implementation is also wrong: https://github.com/multiformats/py-multicodec/blob/master/multicodec/constants.py # miscellaneous
# disabling bin because its prefix collides with base2
'bin': {'prefix': 0x55, },
# bases encodings
'base1': {'prefix': 0x01, },
# 'base2': {'prefix': 0x55, },
'base8': {'prefix': 0x07, },
'base10': {'prefix': 0x09, }, |
Gah... |
Let's continue all discussion on your new issue (#89) so we don't split it. |
Ok. This valid raw varint code.
Empty string or 0x00 or what?
Only when i open raw table.csv i see " in there.
This not valid raw varint code.
Can be same codes in different sections?
In multiformats/multihash#55 (comment) i use raw varint prefix
Is there conflict with sctp?
The text was updated successfully, but these errors were encountered: