diff options
| author | Adam Mathes <adam@adammathes.com> | 2026-02-14 14:46:37 -0800 |
|---|---|---|
| committer | Adam Mathes <adam@adammathes.com> | 2026-02-14 14:46:37 -0800 |
| commit | afa87af01c79a9baa539f2992d32154d2a4739bd (patch) | |
| tree | 92c7416db734270a2fee1d72ee9cc119379ff8e1 /vanilla/node_modules/@exodus/bytes/base32.js | |
| parent | 3b927e84d200402281f68181cd4253bc77e5528d (diff) | |
| download | neko-afa87af01c79a9baa539f2992d32154d2a4739bd.tar.gz neko-afa87af01c79a9baa539f2992d32154d2a4739bd.tar.bz2 neko-afa87af01c79a9baa539f2992d32154d2a4739bd.zip | |
task: delete vanilla js prototype\n\n- Removed vanilla/ directory and web/dist/vanilla directory\n- Updated Makefile, Dockerfile, and CI workflow to remove vanilla references\n- Cleaned up web/web.go to remove vanilla embed and routes\n- Verified build and tests pass\n\nCloses NK-2tcnmq
Diffstat (limited to 'vanilla/node_modules/@exodus/bytes/base32.js')
| -rw-r--r-- | vanilla/node_modules/@exodus/bytes/base32.js | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/vanilla/node_modules/@exodus/bytes/base32.js b/vanilla/node_modules/@exodus/bytes/base32.js deleted file mode 100644 index 1c45766..0000000 --- a/vanilla/node_modules/@exodus/bytes/base32.js +++ /dev/null @@ -1,39 +0,0 @@ -import { assertEmptyRest } from './assert.js' -import { typedView } from './array.js' -import { E_STRING } from './fallback/_utils.js' -import * as js from './fallback/base32.js' - -// See https://datatracker.ietf.org/doc/html/rfc4648 - -// 8 chars per 5 bytes - -export const toBase32 = (arr, { padding = false } = {}) => js.toBase32(arr, false, padding) -export const toBase32hex = (arr, { padding = false } = {}) => js.toBase32(arr, true, padding) - -// By default, valid padding is accepted but not required -export function fromBase32(str, options) { - if (!options) return fromBase32common(str, false, 'both', 'uint8', null) - const { format = 'uint8', padding = 'both', ...rest } = options - return fromBase32common(str, false, padding, format, rest) -} - -export function fromBase32hex(str, options) { - if (!options) return fromBase32common(str, true, 'both', 'uint8', null) - const { format = 'uint8', padding = 'both', ...rest } = options - return fromBase32common(str, true, padding, format, rest) -} - -function fromBase32common(str, isBase32Hex, padding, format, rest) { - if (typeof str !== 'string') throw new TypeError(E_STRING) - if (rest !== null) assertEmptyRest(rest) - - if (padding === true) { - if (str.length % 8 !== 0) throw new SyntaxError(js.E_PADDING) - } else if (padding === false) { - if (str.endsWith('=')) throw new SyntaxError('Did not expect padding in base32 input') - } else if (padding !== 'both') { - throw new TypeError('Invalid padding option') - } - - return typedView(js.fromBase32(str, isBase32Hex), format) -} |
