Skip to content
This repository was archived by the owner on Oct 4, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
// are little-endian.
export function base64ToPasscodes(base64: string): Uint32Array {
return new Uint32Array(
Uint8Array.from(
Buffer.from(base64, "base64")
).buffer
new Uint8Array([...atob(base64)].map(c => c.fromCodePoint(0))).buffer
);
}

export function passcodesToBase64(passcodes: Uint32Array): string {
return Buffer.from(new Uint8Array(passcodes.buffer)).toString("base64");
return btoa(String.fromCodePoint(...new Uint8Array(passcodes.buffer)))
}


Expand Down