summaryrefslogtreecommitdiff
path: root/packages/frontend/src/scripts/2fa.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-09-24 18:21:31 +0900
committerGitHub <noreply@github.com>2023-09-24 18:21:31 +0900
commitf32915b515f4cbc3b1a877cfb8e8e35bf6a31efa (patch)
tree0f6f098cbb282e4b6619152b14b9e6f57e6b448f /packages/frontend/src/scripts/2fa.ts
parentMerge pull request #11384 from misskey-dev/develop (diff)
parent2023.9.0 (diff)
downloadmisskey-f32915b515f4cbc3b1a877cfb8e8e35bf6a31efa.tar.gz
misskey-f32915b515f4cbc3b1a877cfb8e8e35bf6a31efa.tar.bz2
misskey-f32915b515f4cbc3b1a877cfb8e8e35bf6a31efa.zip
Merge pull request #11874 from misskey-dev/develop
Release: 2023.9.0
Diffstat (limited to 'packages/frontend/src/scripts/2fa.ts')
-rw-r--r--packages/frontend/src/scripts/2fa.ts33
1 files changed, 0 insertions, 33 deletions
diff --git a/packages/frontend/src/scripts/2fa.ts b/packages/frontend/src/scripts/2fa.ts
deleted file mode 100644
index 62a38ff02a..0000000000
--- a/packages/frontend/src/scripts/2fa.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-export function byteify(string: string, encoding: 'ascii' | 'base64' | 'hex') {
- switch (encoding) {
- case 'ascii':
- return Uint8Array.from(string, c => c.charCodeAt(0));
- case 'base64':
- return Uint8Array.from(
- atob(
- string
- .replace(/-/g, '+')
- .replace(/_/g, '/'),
- ),
- c => c.charCodeAt(0),
- );
- case 'hex':
- return new Uint8Array(
- string
- .match(/.{1,2}/g)
- .map(byte => parseInt(byte, 16)),
- );
- }
-}
-
-export function hexify(buffer: ArrayBuffer) {
- return Array.from(new Uint8Array(buffer))
- .reduce(
- (str, byte) => str + byte.toString(16).padStart(2, '0'),
- '',
- );
-}
-
-export function stringify(buffer: ArrayBuffer) {
- return String.fromCharCode(... new Uint8Array(buffer));
-}