append() number bug fix

This commit is contained in:
ferricles 2022-06-24 00:43:24 -07:00
parent 7e82213b36
commit c7054ce25a

View file

@ -379,7 +379,7 @@ Base64 = (function () {
//could be split between multiple new ints //could be split between multiple new ints
//reminder that shifts implicitly mod 32 //reminder that shifts implicitly mod 32
bit_vec[bit_vec.length - 1] |= ((int & ~((~0) << length)) << (this.length)); bit_vec[bit_vec.length - 1] |= ((int & ~((~0) << length)) << (this.length));
if (((this.length + length) % 32 < ((this.length - 1) % 32) + 1) || ((this.length + length) % 32 != 0)) { if (((this.length - 1) % 32 + 1) + length > 32) {
bit_vec.push(int >>> (32 - this.length)); bit_vec.push(int >>> (32 - this.length));
} }
} else { } else {