File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,8 @@ class CharSet {
4
4
constructor ( chars , ndxFn ) {
5
5
this . chars = chars
6
6
this . ndxFn = ndxFn
7
- this . len = chars . length
8
- this . entropyPerChar = Math . floor ( Math . log2 ( this . len ) )
9
- if ( this . entropyPerChar != Math . log2 ( this . len ) ) {
7
+ this . entropyPerChar = Math . floor ( Math . log2 ( chars . length ) )
8
+ if ( this . entropyPerChar != Math . log2 ( chars . length ) ) {
10
9
throw new Error ( 'EntropyString only supports CharSets with a power of 2 characters' )
11
10
}
12
11
this . charsPerChunk = lcm ( this . entropyPerChar , 8 ) / this . entropyPerChar
@@ -15,7 +14,7 @@ class CharSet {
15
14
use ( chars ) {
16
15
const len = chars . length
17
16
// Ensure correct number of characters
18
- if ( len != this . len ) {
17
+ if ( len != this . chars . length ) {
19
18
throw new Error ( 'Invalid character count' )
20
19
}
21
20
// Ensure no repeated characters
You can’t perform that action at this time.
0 commit comments