-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
use hash-base #36
use hash-base #36
Conversation
|
||
- SHA (SHA-0) -- **legacy, no not use in new systems** | ||
- SHA-1 -- **legacy, no not use in new systems** |
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.
do not, not no not
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.
Fixed, thanks.
I doubted about this phrase, but decided not change it when edited README.md
3a2038a
to
e6e054c
Compare
var inherits = require('inherits') | ||
var SHA = require('./sha') | ||
|
||
var ARRAY80 = new Array(80) |
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.
Maybe just call this var W = new Array(80)
, and let it be super clear that it is a global used by _getExpandedMessage
[by moving it to just above that declaration]
utACK e6e054c, |
e6e054c
to
7ba67d6
Compare
7ba67d6
to
7d049ec
Compare
@dcousens updated |
Published as |
Why did you move the files to Also, I personally prefer functions before use, but hey, its still |
|
||
SHA.prototype._expandMessage = function (W) { | ||
for (var i = 0; i < 16; ++i) W[i] = this._block.readInt32BE(i * 4) | ||
for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16] |
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.
Where did this come from?
var e = this._e | 0 | ||
|
||
for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4) | ||
for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16] |
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.
Ah, this. All good 👍
} | ||
} else { | ||
usage() | ||
} |
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.
Ah, wait.
This is a breaking change.
Can you please re-add so I can release a fixed patch?
Why did you remove |
Re-added |
exports.sha224 = require('./sha224') | ||
exports.sha256 = require('./sha256') | ||
exports.sha384 = require('./sha384') | ||
exports.sha512 = require('./sha512') |
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.
Sigh
@fanatid also please mark things as major bump if they are. I spent most of my review time looking over the math changes/refactors instead of focusing on the exports... apologies all (as they weren't flagged as changed). Unpublished |
@fanatid can you please re-add the tests, un-change the exports to avoid breaking backwards compatibility and then submit that PR, so we can release this as a non-breaking change? |
I think hash-base makes breaking changes anyway. |
@fanatid not willing to be backwards compatible in |
are you think that this necessary? |
Just to note, as others may come across this as well, this update broke some of our projects which use this module, but don't use browserify. |
@gethinwebster sorry hear this, but is not |
It doesn't seem to - looks like 2.4.7 still uses hash-base unless I'm missing something? |
ah, I see :( |
2.4.5 is the latest version that works correctly for me |
Ah, so moving the files into lib was a breaking change. and so I have lots of stuff that is broken now. If it goes into lib it needs a major semver bump |
Agreed, I commonly use it like
|
Unpublish wasn't working as expected for @dominictarr @fanatid please verify. Sorry for the screw-around @gethinwebster. |
yup, working again. |
@fanatid please submit atomic PRs for the changes 👍 |
@fanatid what were the blocks here? |
I know this is a very very VERY old PR, but I'd like to double check something. I actually do like this version because it uses |
Ref #25