fn hexEncode(s: String) -> String
A string's UTF-8 bytes as lowercase hex, two digits per byte.
Type to search, or try , or .
7 exports, from std/codecs.vyrn.
Hex, base64 and percent encoding over UTF-8 bytes. These are the hexEncode, hexDecode, base64Encode, base64Decode, urlEncode and urlDecode builtins on every engine; tests/codecs.rs pins their output.
A decoder whose bytes contain 0x00 returns None: a Vyrn String cannot hold a NUL, and stringFromBytes enforces it.
The import graph shows the whole library.
fn hexEncode(s: String) -> String
A string's UTF-8 bytes as lowercase hex, two digits per byte.
fn hexDecode(s: String) -> Option<String>
Hex text back to a String; None on an odd length, a non-hex digit, or bytes that are not valid UTF-8. Reads either case.
fn base64Encode(s: String) -> String
fn base64EncodeBytes(b: Array<UInt8>) -> String
Base64 of bytes that are not text, such as a digest: they can hold a NUL and need not be UTF-8.
fn base64Decode(s: String) -> Option<String>
Base64 text back to a String; None unless the length is a multiple of four, every digit is in the alphabet, padding is = or == in the final group only, and the bytes are valid UTF-8.
fn urlEncode(s: String) -> String
A string's UTF-8 bytes percent-encoded, uppercase hex.
fn urlDecode(s: String) -> Option<String>
Percent-encoded text back to a String; None on a truncated or non-hex escape, or bytes that are not valid UTF-8. A raw space or + decodes to itself.
4 test blocks in std/codecs.vyrn. CI runs all of them.
2 programs in examples/ import this module. Each runs as WebAssembly and as a native binary.