We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9b048d5 commit b0b1b88Copy full SHA for b0b1b88
1 file changed
lib/charSet.js
@@ -79,13 +79,15 @@ const _ndxFn = (bitsPerChar) => {
79
let slicesPerChunk = lcm(bitsPerChar, bitsPerByte) / bitsPerByte
80
let bNum = chunk * slicesPerChunk
81
82
+ let offset = (slice*bitsPerChar)/bitsPerByte
83
+ let lOffset = Math.floor(offset)
84
+ let rOffset = Math.ceil(offset)
85
+
86
let rShift = bitsPerByte - bitsPerChar
- let lOffset = Math.floor((slice*bitsPerChar)/bitsPerByte)
87
let lShift = (slice*bitsPerChar) % bitsPerByte
88
89
let ndx = ((bytes[bNum+lOffset]<<lShift)&0xff)>>rShift
90
- let rOffset = Math.ceil((slice*bitsPerChar)/bitsPerByte)
91
let rShiftIt = ((rOffset+1)*bitsPerByte - (slice+1)*bitsPerChar) % bitsPerByte
92
if (rShift < rShiftIt) {
93
ndx += bytes[bNum+rOffset]>>rShiftIt
0 commit comments