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 {
44 constructor ( chars , ndxFn ) {
55 this . chars = chars
66 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 ) ) {
109 throw new Error ( 'EntropyString only supports CharSets with a power of 2 characters' )
1110 }
1211 this . charsPerChunk = lcm ( this . entropyPerChar , 8 ) / this . entropyPerChar
@@ -15,7 +14,7 @@ class CharSet {
1514 use ( chars ) {
1615 const len = chars . length
1716 // Ensure correct number of characters
18- if ( len != this . len ) {
17+ if ( len != this . chars . length ) {
1918 throw new Error ( 'Invalid character count' )
2019 }
2120 // Ensure no repeated characters
You can’t perform that action at this time.
0 commit comments