Use async hypercore-encryption module#676
Merged
Conversation
e5e6ba0 to
ee015b2
Compare
Contributor
Author
|
we need to publish https://github.com/holepunchto/hypercore-block-encryption once we're happy with it |
mafintosh
reviewed
Mar 18, 2025
index.js
Outdated
| } | ||
|
|
||
| function isEncryptionProvider (e) { | ||
| return !!(e && (e instanceof HypercoreEncryption || (e.encrypt && typeof e.encrypt === 'function'))) |
Contributor
There was a problem hiding this comment.
you can just do the instanceof check
RangerMauve
reviewed
Mar 24, 2025
|
|
||
| if (this.encryption.compat !== this.core.compat) this._updateEncryption() | ||
|
|
||
| for (let i = 0; i < blocks.length; i++) { |
Contributor
There was a problem hiding this comment.
Should this maybe be done in parallel using something like await Promise.all(blocks.map(encrypt))? This seems like a major perf regression otherwise.
Contributor
There was a problem hiding this comment.
same as today since sync right now, but we can adjust later. the async'ness is there for flexibility. for now lets keep it simple.
hypercore-block-encryption modulehypercore-encryption module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.