Text and data

  • Use String to cut, search, change and convert text, and to turn text into numbers.
  • Use Regex (std/regex) to search, extract, replace and split text with regular expressions.
  • Use Int and Float to convert between Int, Float and String, to round, clamp and take square roots, and to work on bits.
  • Use JSON to move data in and out of programs, for a known shape (structs) or not.
  • Use Binary data (std/binary) to read and write numbers in a Bytes, and to frame messages.
  • Use TOML (std/toml) to read and write TOML 1.0 documents, such as configuration files.
  • Use HTML (std/html) to escape and unescape HTML text.
  • Use EAG templates (<<~EAG and std/eag) to build text from a template with ERB tags.
  • Use Cookie (std/cookie) to read a Cookie header and to write a Set-Cookie header.
  • Use MIME (std/mime) to find the media type of a file from its name, and to tell which types are text.
  • Use UTC (std/utc) to turn Unix milliseconds into the date and time in UTC and into RFC 3339 text.
  • Use URI (std/uri) to percent-encode and decode URL components and to read and write query strings.
  • Use the OpenSSL builtins to hash a list of bytes with MD5, SHA-1, SHA-256 or SHA-512, to sign it with HMAC-SHA256 or HMAC-SHA512, to compare MACs in constant time, to encrypt with AES-256-GCM, to hash passwords with PBKDF2 and scrypt, to encrypt and MAC payment data with Triple DES and CMAC, to encrypt with an RSA public key, and to draw secure random bytes, hex and UUIDs.
  • Use Zlib to compress bytes, files and streams with DEFLATE, zlib and gzip.
  • Use Base64 and hex to write bytes as text and read them back.

The tour pages Strings and Numbers are a short start.