Skip to content

Commit

Permalink
fix(#242): use TextEncoder when mapping token to UInt8Array
Browse files Browse the repository at this point in the history
  • Loading branch information
awinogrodzki committed Sep 3, 2024
1 parent d2d7350 commit 23b04dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/auth/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ export function deepExtend<T>(target: T, source: T): T {
return target;
}

const encoder = new TextEncoder();

export function toUint8Array(key: string) {
return Uint8Array.from(key.split('').map((x) => x.charCodeAt(0)));
return encoder.encode(key);
}

0 comments on commit 23b04dc

Please sign in to comment.