Std\Encoding
Encoding – string encoding and decoding utilities.
Provides Base64, hex, URL percent-encoding, and HTML entity escaping.
Functions
Section titled “Functions”base64Encode : String -> String
Section titled “base64Encode : String -> String”Encode a string to Base64.
import base64Encode from Std\Encoding inbase64Encode "hello" # => "aGVsbG8="base64Decode : String -> String
Section titled “base64Decode : String -> String”Decode a Base64-encoded string back to its original form.
import base64Decode from Std\Encoding inbase64Decode "aGVsbG8=" # => "hello"hexEncode : String -> String
Section titled “hexEncode : String -> String”Encode each byte of a string as two hex characters.
import hexEncode from Std\Encoding inhexEncode "AB" # => "4142"hexDecode : String -> String
Section titled “hexDecode : String -> String”Decode a hex-encoded string back to bytes.
import hexDecode from Std\Encoding inhexDecode "4142" # => "AB"urlEncode : String -> String
Section titled “urlEncode : String -> String”Percent-encode a string for use in URLs.
import urlEncode from Std\Encoding inurlEncode "hello world" # => "hello%20world"urlDecode : String -> String
Section titled “urlDecode : String -> String”Decode a percent-encoded URL string.
import urlDecode from Std\Encoding inurlDecode "hello%20world" # => "hello world"htmlEscape : String -> String
Section titled “htmlEscape : String -> String”Escape HTML special characters (<, >, &, ", ') to their entity equivalents.
import htmlEscape from Std\Encoding inhtmlEscape "<b>hi</b>" # => "<b>hi</b>"