Allow Id to have arbitrary length instead of 16 byte limit, also add in POJO and Map tests #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
As discussed in MatrixAI/Polykey#254, we want
Id
to be usable forNodeId
as well. In such a case, we don't actually want the 16 byte limit that we have in ourutils.ts
atm. This is only relevant to UUID. So the limit can be constraint to UUID conversions, and all other functions can operate more freely.Issues Fixed
GenericIdTypes.ts
Polykey#299NodeId
as a proxy/singleton instance Polykey#254Tasks
16
byte check totoUUID
, and throwRangeError
if theId
is not 16 bytes16
byte limit from other conversion utilities like string, buffer and multibaseId.test.ts
to test Id creation byitselfId
can be used as Map keys, and POJO keys without any problemsFinal checklist