Skip to content

Commit 80dc87a

Browse files
committed
reorder
1 parent 1e3863b commit 80dc87a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/primitives/Hash.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,14 @@ abstract class BaseHash {
179179
}
180180

181181
// Append length
182-
const maxBits = 1n << BigInt(this.padLength * 8)
182+
const lengthBytes = this.padLength
183+
const maxBits = 1n << BigInt(lengthBytes * 8)
183184
let totalBits = BigInt(len) * 8n
184185

185186
if (totalBits >= maxBits) {
186187
throw new Error('Message too long for this hash function')
187188
}
188-
189-
const lengthBytes = this.padLength
189+
190190
if (this.endian === 'big') {
191191
const lenArray = new Array<number>(lengthBytes)
192192

0 commit comments

Comments
 (0)