-
Notifications
You must be signed in to change notification settings - Fork 32
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
support append and middlestate #40
Conversation
support append and middlestate
update self$2 to self
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good, thanks! Just a few smaller remarks that would be great if you could address them.
@@ -1 +1,3 @@ | |||
node_modules | |||
test/bundle.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for adding these to the gitignore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'am so sorry. I will remove it, that code is introduced not carefully When test.
@@ -300,6 +312,69 @@ | |||
return hex(rawDigest(str).buffer); | |||
}; | |||
|
|||
this.start = function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering whether resetState
could be a better name for this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a good idea.thanks
this.getState = function () { | ||
var turnOffset = self.offset % self.maxChunkLen, | ||
heap; | ||
if(!turnOffset){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great if you could adhere to the code style here, and insert spaces before {
and (
, and after }
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for your advice, i'll resolve them.
1. Rename method 2. Adhere to the source code style
Thanks for your contribution! I'll make sure to release a new version as soon as possible. |
Rusha is the fastest shajs library we used, but the rusha does not support append, one case does not support large files at the same time concurrent computation, resulting in our webworker use is not flexible, so we extend the implementation of append, getState and setState. At present, we use the transformation Library in https://mail.qq.com every day to calculate the total amount of file size of more than 10T.