ws-3d: codecs/Base64 (RFC 4648 standard + url, padding optional, whitespace-tolerant decode, data: URIs); shared: glTF data URIs now, YAML !!binary / Brotli's dictionary / SVG could use it instead of private copies

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
4DBugandClaude Opus 5.5 committed 2026-10-31 08:47:36 -05:00
1 parent c84d00137d
commit 0276eda0e1
3 files changed
+199

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
# Base64 fixtures (tools/fixtures.py): random byte strings of every length 0..70 plus a few large ones, with Python's
# base64 (standard, URL-safe, unpadded) as the reference.
# tests/gen/base64_cases.luau { data, std, url, nopad }
import base64
def generate(ctx):
rng = ctx.rng(3)
cases = []
for n in list(range(71)) + [1000, 4097, 65536]:
d = bytes(rng.randrange(256) for _ in range(n))
cases.append({"data": d, "std": base64.b64encode(d), "url": base64.urlsafe_b64encode(d), "nopad": base64.b64encode(d).rstrip(b"=")})
ctx.emit("base64_cases", cases)