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

Consider using crypto to generate md5/sha1 hashes #24

Open
wovalle opened this issue Oct 5, 2022 · 2 comments
Open

Consider using crypto to generate md5/sha1 hashes #24

wovalle opened this issue Oct 5, 2022 · 2 comments

Comments

@wovalle
Copy link

wovalle commented Oct 5, 2022

First of all, thank you for the library!

Have you considered using crypto.createHash to create md5/sha1 hashes instead of the js dependencies?

This would allow us to use your libraries in non-node runtimes like cloudflare workers (currently it fails because js-md5 contains eval which is usually a no-no for security reasons).

I created a temporary fork and replaced the dependencies for the native crypto and all tests passed succesfully, can create a PR if you agree.

Thanks!

@doroved
Copy link

doroved commented Mar 13, 2023

First of all, thank you for the library!

Have you considered using crypto.createHash to create md5/sha1 hashes instead of the js dependencies?

This would allow us to use your libraries in non-node runtimes like cloudflare workers (currently it fails because js-md5 contains eval which is usually a no-no for security reasons).

I created a temporary fork and replaced the dependencies for the native crypto and all tests passed succesfully, can create a PR if you agree.

Thanks!

Hi, is it possible to adapt this script to work in a browser?

@wovalle
Copy link
Author

wovalle commented Mar 15, 2023

I think this library is only exported as a commonjs module. If it is exported as an esmodule + those two dependencies I mentioned are replaced, this would be 100% browser compatible.

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

No branches or pull requests

2 participants