chore: use "is_multiple_of" method
This commit is contained in:
@@ -77,7 +77,7 @@ impl MT19937 {
|
||||
for i in 0..624 {
|
||||
let y: u32 = (self.mt[i] & 0x80000000) + (self.mt[(i + 1) % 624] & 0x7fffffff);
|
||||
self.mt[i] = self.mt[(i + 397) % 624] ^ (y >> 1);
|
||||
if y % 2 != 0 {
|
||||
if !y.is_multiple_of(2) {
|
||||
self.mt[i] ^= 0x9908b0df;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,6 @@
|
||||
// w[i] = (w[i-6] xor w[i-16] xor w[i-28] xor w[i-32]) leftrotate 2
|
||||
// This transformation keeps all operands 64-bit aligned and, by removing the dependency of w[i] on w[i-3], allows efficient SIMD implementation with a vector length of 4 like x86 SSE instructions.
|
||||
|
||||
use hex;
|
||||
use sha1::{Digest, Sha1};
|
||||
|
||||
fn sha1(input: &[u8]) -> [u8; 20] {
|
||||
|
||||
Reference in New Issue
Block a user