@@ -120,7 +120,7 @@ impl Hasher for RpJive64_256 {
120120 // compute the number of elements required to represent the string; we will be processing
121121 // the string in 7-byte chunks, thus the number of elements will be equal to the number
122122 // of such chunks (including a potential partial chunk at the end).
123- let num_elements = if bytes. len ( ) % 7 == 0 {
123+ let num_elements = if bytes. len ( ) . is_multiple_of ( 7 ) {
124124 bytes. len ( ) / 7
125125 } else {
126126 bytes. len ( ) / 7 + 1
@@ -129,7 +129,7 @@ impl Hasher for RpJive64_256 {
129129 // initialize state to all zeros, except for the first element of the capacity part, which
130130 // is set to 1 if the number of elements is not a multiple of RATE_WIDTH.
131131 let mut state = [ BaseElement :: ZERO ; STATE_WIDTH ] ;
132- if num_elements % RATE_WIDTH != 0 {
132+ if ! num_elements. is_multiple_of ( RATE_WIDTH ) {
133133 state[ CAPACITY_RANGE . start ] = BaseElement :: ONE ;
134134 }
135135
@@ -157,7 +157,7 @@ impl Hasher for RpJive64_256 {
157157 // absorbing again from zero index.
158158 state[ RATE_RANGE . start + i] += BaseElement :: new ( u64:: from_le_bytes ( buf) ) ;
159159 i += 1 ;
160- if i % RATE_WIDTH == 0 {
160+ if i. is_multiple_of ( RATE_WIDTH ) {
161161 Self :: apply_permutation ( & mut state) ;
162162 i = 0 ;
163163 }
@@ -236,7 +236,7 @@ impl ElementHasher for RpJive64_256 {
236236 // initialize state to all zeros, except for the first element of the capacity part, which
237237 // is set to 1 if the number of elements is not a multiple of RATE_WIDTH.
238238 let mut state = [ BaseElement :: ZERO ; STATE_WIDTH ] ;
239- if elements. len ( ) % RATE_WIDTH != 0 {
239+ if ! elements. len ( ) . is_multiple_of ( RATE_WIDTH ) {
240240 state[ CAPACITY_RANGE . start ] = BaseElement :: ONE ;
241241 }
242242
@@ -247,7 +247,7 @@ impl ElementHasher for RpJive64_256 {
247247 for & element in elements. iter ( ) {
248248 state[ RATE_RANGE . start + i] += element;
249249 i += 1 ;
250- if i % RATE_WIDTH == 0 {
250+ if i. is_multiple_of ( RATE_WIDTH ) {
251251 Self :: apply_permutation ( & mut state) ;
252252 i = 0 ;
253253 }
0 commit comments