webtorrent / bittorrent-dht

🕸 Simple, robust, BitTorrent DHT implementation
https://webtorrent.io
MIT License
1.23k stars 203 forks source link

Allow signing mutable data asynchronously #223

Open BkPHcgQL3V opened 3 years ago

BkPHcgQL3V commented 3 years ago

This can be useful if we want to keep the private key out of the process.

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update [ ] Bug fix [X] New feature [ ] Other, please explain:

What changes did you make? (Give an overview)

If the sign field in opts has two arguments, assume the second one is for an asynchronous callback.

Restructure the code to accommodate this.

Which issue (if any) does this pull request address?

None.

Is there anything you'd like reviewers to focus on?

Maybe there is too much green for such a small addition.

welcome[bot] commented 3 years ago

🙌 Thanks for opening this pull request! You're awesome.