Data and Math

vbase64

Base64 and hex encoding, for data that has to travel as text.

Released v1.0.0 · 2026-09-28
Import
use "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.

vbase64.ven
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: hello

b64decode(text)

print(b64decode("aGVsbG8="))
:: prints: hello

urlsafe_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: 7A6F6F

b16decode(text)

print(b16decode("7A6F6F"))
print(b16decode(lowercase("7A6F6F")))
:: prints: zoo
:: prints: zoo

Get notified when vbase64 changes

Get notified about

New versions and security advisories.

New and updated packages, once a day.

News on the math model built in Venutian.