Skip to content
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

feat: use secure sha256 algorithm #12

Merged
merged 3 commits into from Jul 14, 2022
Merged

feat: use secure sha256 algorithm #12

merged 3 commits into from Jul 14, 2022

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Jul 14, 2022

Murmurhash is recently known for many collisions (#11). This PR changes default hash implementation to more secure sha256 using a tree-shaked and improved pure-js implementation from crypto-js.

Bundle size impact: Base build contains both murmur and sha256 to avoid breaking changes and is increased from 37KB ~> 60 KB but tree-shaken and minified version of { hash } import remains the same (~8KB) and universal.

Future enhancements: Implementation of crypto-js is picked since was well tested but it can be improved more by reducing class usage. IV can be lazy initialized and we could opt into native crypto by using async hash interface (Node.js can use crypto module as well but left for now to avoid package format changes)

@pi0 pi0 changed the title feat: use secure sha256 feat: use secure sha256 algorithm Jul 14, 2022
@DRoet
Copy link

DRoet commented Jul 15, 2022

I could be wrong, but this PR seems to introduce a yarn.lock file whilst the project is configured with pnpm

@pi0
Copy link
Member Author

pi0 commented Jul 15, 2022

Thanks for notice @DRoet :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants