diff options
author | Sebastian <sebasjm@gmail.com> | 2023-03-13 11:12:46 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-03-13 11:27:52 -0300 |
commit | 96d110379e9bfbffedfeebf44c1c972b12fffff4 (patch) | |
tree | e7065608cd1561d000f9d2eef79a4ff3e4611e16 /packages/merchant-backoffice-ui/src/utils/crypto.ts | |
parent | 5f681813cf1bb7bb5c0baa41f29011d0029d003d (diff) | |
download | wallet-core-96d110379e9bfbffedfeebf44c1c972b12fffff4.tar.xz |
some fixes and validations
Diffstat (limited to 'packages/merchant-backoffice-ui/src/utils/crypto.ts')
-rw-r--r-- | packages/merchant-backoffice-ui/src/utils/crypto.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/merchant-backoffice-ui/src/utils/crypto.ts b/packages/merchant-backoffice-ui/src/utils/crypto.ts index 7bab8abf1..27e6ade02 100644 --- a/packages/merchant-backoffice-ui/src/utils/crypto.ts +++ b/packages/merchant-backoffice-ui/src/utils/crypto.ts @@ -46,6 +46,14 @@ function encodeBase32(data: ArrayBuffer) { return sb; } +export function isBase32RFC3548Charset(s: string): boolean { + for (let idx = 0; idx < s.length; idx++) { + const c = s.charAt(idx); + if (encTable.indexOf(c) === -1) return false; + } + return true; +} + export function randomBase32Key(): string { var buf = new Uint8Array(20); window.crypto.getRandomValues(buf); |