Skip to content

Commit

Permalink
Merge pull request #81 from steveluscher/this-but-faster
Browse files Browse the repository at this point in the history
Improve decoding performance
  • Loading branch information
junderw authored Jul 4, 2024
2 parents 39f2673 + 261fb36 commit 64e196c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cjs/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function base (ALPHABET) {
const size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up.
const b256 = new Uint8Array(size)
// Process the characters.
while (source[psz]) {
while (psz < source.length) {
// Decode character
let carry = BASE_MAP[source.charCodeAt(psz)]
// Invalid character
Expand Down
2 changes: 1 addition & 1 deletion src/esm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function base (ALPHABET) {
const size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up.
const b256 = new Uint8Array(size)
// Process the characters.
while (source[psz]) {
while (psz < source.length) {
// Decode character
let carry = BASE_MAP[source.charCodeAt(psz)]
// Invalid character
Expand Down
2 changes: 1 addition & 1 deletion ts_src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function base (ALPHABET: string): base.BaseConverter {
const b256 = new Uint8Array(size)

// Process the characters.
while (source[psz]) {
while (psz < source.length) {
// Decode character
let carry = BASE_MAP[source.charCodeAt(psz)]

Expand Down

0 comments on commit 64e196c

Please sign in to comment.