-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
7 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
import 'dart:typed_data'; | ||
|
||
import 'package:fixnum/fixnum.dart'; | ||
const _mask32 = 0xffffffff; | ||
|
||
/// Author Nguyen Van Nguyen <[email protected]> | ||
extension IntExt on int { | ||
|
@@ -43,20 +43,20 @@ extension IntExt on int { | |
} | ||
|
||
int shiftLeft32(final int n) { | ||
return (Int64(toUnsigned(32)) << n).toInt(); | ||
return (this & _mask32) << n; | ||
} | ||
|
||
int shiftRight32(final int n) { | ||
return (Int64(toUnsigned(32)) >> n).toInt(); | ||
return (this & _mask32) >> n; | ||
} | ||
|
||
int rotateLeft32(final int n) { | ||
final num = Int64(toUnsigned(32)); | ||
return ((num << n) + (num >> (32 - n))).toInt(); | ||
final num = this & _mask32; | ||
return (num << n) | (num >> 32 - n); | ||
} | ||
|
||
int rotateRight32(final int n) { | ||
final num = Int64(toUnsigned(32)); | ||
return ((num >> n) + (num << (32 - n))).toInt(); | ||
final num = this & _mask32; | ||
return (num >> n) | (num << 32 - n); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ environment: | |
sdk: ^3.2.0 | ||
|
||
dependencies: | ||
fixnum: ^1.1.0 | ||
pinenacl: ^0.6.0 | ||
pointycastle: ^3.9.1 | ||
|
||
|