Skip to content

Commit

Permalink
fix: fix an algorithm error
Browse files Browse the repository at this point in the history
  • Loading branch information
mogeko committed Sep 28, 2024
1 parent f6ce5cf commit 482925f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/encoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ function encode6bit(b: number) {

function encode3bytes(b1: number, b2: number, b3: number) {
return encode6bit((b1 >> 2) & 0x3f).concat(
encode6bit(((b1 & 0x3) << 4) | ((b2 >> 4) & 0x3f)),
encode6bit(((b2 & 0xf) << 2) | ((b3 >> 6) & 0x3f)),
encode6bit((((b1 & 0x3) << 4) | (b2 >> 4)) & 0x3f),
encode6bit((((b2 & 0xf) << 2) | (b3 >> 6)) & 0x3f),
encode6bit(b3 & 0x3f),
);
}
Expand Down

0 comments on commit 482925f

Please sign in to comment.