use new template

This commit is contained in:
2026-01-22 10:19:50 +01:00
parent d74f3e2d43
commit c6e7486894
11 changed files with 110 additions and 42 deletions
+28
View File
@@ -0,0 +1,28 @@
import {a2b64, a2str, b642a, str2a} from '..'
import {test, expect} from 'bun:test'
test('str2a and a2str are reciprocal', () => {
const from = "Testing value !"
let buff = str2a(from)
let to = a2str(buff)
expect(to).toBe(from)
})
test('b642a and a2b64 are reciprocal', () => {
const from_str = "Testing value !"
const from = btoa(from_str)
let buff = b642a(from)
expect(buff).not.toBeNull()
let to = a2b64(buff!)
expect(to).toBe(from)
})
test("b642a doesn't accept invalid b64", () => {
expect(b642a("pa'0ac'i !!")).toBeNull()
})