Conversation
commit: |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 24ed7a3
Previous suggestionsSuggestions up to commit 4625f29
✅ Suggestions up to commit ed391a8
Suggestions up to commit aa95d53
✅ Suggestions up to commit f26e205
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PR Code Suggestions ✨No code suggestions found for the PR. |
PR Code Suggestions ✨No code suggestions found for the PR. |
- Browser platform tools are in BrowserPlatformTools.template, putting it in PlatformTools may not work
4625f29 to
24ed7a3
Compare
|
Nice cleanup overall. Dropping sha.js and leaning on node:crypto where it exists is a good move (fewer deps + less surface area). I also like that you kept behavior working outside Node by falling back to RandomGenerator / internal SHA1, and that you added more hashing tests instead of just refactoring and hoping nothing breaks. A couple things I’d keep an eye on:
|
Description of change
Remove
sha.jsdependency, replace with built-incryptomodule in node environments, and ourRandomGeneratorin other environments, internallyRandomGeneratoruses implementation from Locutus.There was a commented function call in
RandomGeneratorthat isunescape(), this line was replaced entirely withTextEncoderwhich is supported by both browsers and Hermes (RN/Expo). To be honest it shouldn't matter anyway the only case where the older implementation would fail (i.e. behave differently that proper SHA1 implementations) is if we use non-ASCII characters, I've looked into where we useRandomGeneratororhashfunction:I don't think any of these instances should accept non-ASCII characters to begin with.
Such discrepancy in where we use
RandomGeneratorvshashis up to the reviewer. Maybe I should refactor all instances ofhashto useRandomGeneratorand updateRandomGeneratorto use built-in crypto if existent, otherwise use Locutus implementation? let me know what you think.I fixed some linting warnings along the way.
Pull-Request Checklist
masterbranchFixes #00000tests/**.test.ts)docs/docs/**.md)