Add controllers and packages for security keys
This commit is contained in:
parent
f8ec8b4d5a
commit
06f692e649
29 changed files with 2398 additions and 383 deletions
9
resources/scripts/lib/buffer.ts
Normal file
9
resources/scripts/lib/buffer.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
function decodeBuffer(value: string): ArrayBuffer {
|
||||
return Uint8Array.from(window.atob(value), c => c.charCodeAt(0));
|
||||
}
|
||||
|
||||
function encodeBuffer(value: ArrayBuffer): string {
|
||||
return btoa(String.fromCharCode(...new Uint8Array(value)));
|
||||
}
|
||||
|
||||
export { decodeBuffer, encodeBuffer };
|
Loading…
Add table
Add a link
Reference in a new issue