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

How to use it in js worker? #14

Open
pickzhu opened this issue Jun 9, 2022 · 2 comments
Open

How to use it in js worker? #14

pickzhu opened this issue Jun 9, 2022 · 2 comments

Comments

@pickzhu
Copy link

pickzhu commented Jun 9, 2022

I want it to do SHA1 in js worker, what needs to be done for this?

@junhui93
Copy link

先把js文件下载下来
https://raw.github.com/emn178/js-sha1/master/build/sha1.min.js
或着
https://raw.github.com/emn178/js-sha1/master/src/sha1.js
将里面的内容保存到sha1.js文件下

const sha1 = require("../../../static/sha1.js");
引用你保存的文件
var ada = sha1("123456");
console.log(ada);
得到
7c4a8d09ca3762af61e59520943dc26494f8941b

emn178 added a commit that referenced this issue Jan 24, 2024
- TypeScript interfaces. #6, #9
- HMAC feature.
- support for web worker. #14

### Fixed
- deprecated `new Buffer`, replace with `Buffer.from`. #10
- dependencies and security issues.
- refactor: simplify formatMessage internal logic.
- Generates incorrect hash in some cases.

### Changed
- remove `eval` and use `require` directly. #8
- throw error by Error oject.
- throw error if update after finalize
- use unsigned right shift.
@emn178
Copy link
Owner

emn178 commented Jan 24, 2024

v0.7.0 supports worker

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

3 participants