Encode and Decode Base64 in Larzscript
Base64-encode arbitrary text (or decode it back), the standard way binary-ish data travels safely through text-only channels like JSON or URLs.
A single pure-Larzscript implementation, no OS or library call.
larzscript pkg install base64
Code
import "base64" as base64
let encoded = base64.encode("Larzscript is money-native")
print(encoded)
print(base64.decode(encoded))Output
TGFyenNjcmlwdCBpcyBtb25leS1uYXRpdmU= Larzscript is money-native
Related
larzbase64Base64 encode/decode→Parse JSON in LarzscriptParse a JSON string into real Larzscript dicts and lists, and turn data back into JSON text.→Read and Parse a CSV File in LarzscriptParse CSV text into rows, or straight into dicts keyed by header - including quoted fields with embedded commas.→Parse a URL in LarzscriptBreak a URL into its scheme, host, path and query parameters, and safely join a base URL with a relative path.→