-
Notifications
You must be signed in to change notification settings - Fork 50
Remove 64 bit int constant so that dart2js can compile with crypto. #51
Conversation
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.
Please bump the version to 2.0.4 and add a changelog entry!
oops, thank you! Updated! |
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.
LGTM! Please "squash and merge" when travis is green.
2^64 bits several Exa-bytes. |
@@ -25,10 +26,6 @@ abstract class HashSink implements Sink<List<int>> { | |||
/// used across invocations of [_iterate]. | |||
final Uint32List _currentChunk; | |||
|
|||
/// Messages with more than 2^64-1 bits are not supported. | |||
/// So the maximum length in bytes is (2^64-1)/8. | |||
static const _maxMessageLengthInBytes = 0x1fffffffffffffff; |
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.
Use 0x0003FFFFFFFFFFFF instead
The largest number of bytes for which we can count the bits portably across VM and JavaScript, i.e. (2^53-1)/8
…art-archive/crypto#51) * Remove 64 bit int constant.
This change.... is so hair-brained I just can't even.....
The context is dart2js now has full JS number semantics, so it will cough on numbers that are not precisely representable as a double (generally > 2^53). I got around that by making this a BigNum, but it's pretty idiotic. I welcome alternatives. :-/