Data and Math
vbase64
Base64 and hex encoding, for data that has to travel as text.
Released v1.0.0 · 2026-09-28use "stdlib/base64.ven"
Base64 and hex encoding for data that has to travel as text, built on Venutian's own base64 and hex builtins. It adds the URL and filename safe alphabet, which swaps two characters for ones safe inside a URL or a filename, and hex encoding under the names b16encode and b16decode.
encoded = b64encode("hello")
print encoded
print b64decode(encoded)
:: prints: aGVsbG8=
:: prints: hello
Reference (6 functions)
API reference
b64encode(text)
encoded = b64encode("hello")
print(encoded)
print(b64decode(encoded))
:: prints: aGVsbG8=
:: prints: hellob64decode(text)
print(b64decode("aGVsbG8="))
:: prints: hellourlsafe_b64encode(text)
print(b64encode("hi??>>"))
print(urlsafe_b64encode("hi??>>"))
:: prints: aGk/Pz4+
:: prints: aGk_Pz4-urlsafe_b64decode(text)
encoded = urlsafe_b64encode("hi??>>")
print(urlsafe_b64decode(encoded))
:: prints: hi??>>b16encode(text)
print(b16encode("zoo"))
:: prints: 7A6F6Fb16decode(text)
print(b16decode("7A6F6F"))
print(b16decode(lowercase("7A6F6F")))
:: prints: zoo
:: prints: zoo