# Text and data

- Use [String](https://www.agentica-lang.com/agentica/library/text-and-data/string/index.md) to cut, search, change and convert text, and to turn text into numbers.
- Use [Regex](https://www.agentica-lang.com/agentica/library/text-and-data/regex/index.md) (`std/regex`) to search, extract, replace and split text with regular expressions.
- Use [Int and Float](https://www.agentica-lang.com/agentica/library/text-and-data/numbers/index.md) to convert between `Int`, `Float` and `String`, to round, clamp and take square roots, and to work on bits.
- Use [JSON](https://www.agentica-lang.com/agentica/library/text-and-data/json/index.md) to move data in and out of programs, for a known shape (structs) or not.
- Use [Binary data](https://www.agentica-lang.com/agentica/library/text-and-data/binary/index.md) (`std/binary`) to read and write numbers in a `Bytes`, and to frame messages.
- Use [TOML](https://www.agentica-lang.com/agentica/library/text-and-data/toml/index.md) (`std/toml`) to read and write TOML 1.0 documents, such as configuration files.
- Use [HTML](https://www.agentica-lang.com/agentica/library/text-and-data/html/index.md) (`std/html`) to escape and unescape HTML text.
- Use [EAG templates](https://www.agentica-lang.com/agentica/library/text-and-data/eag/index.md) (`<<~EAG` and `std/eag`) to build text from a template with ERB tags.
- Use [Cookie](https://www.agentica-lang.com/agentica/library/text-and-data/cookie/index.md) (`std/cookie`) to read a `Cookie` header and to write a `Set-Cookie` header.
- Use [MIME](https://www.agentica-lang.com/agentica/library/text-and-data/mime/index.md) (`std/mime`) to find the media type of a file from its name, and to tell which types are text.
- Use [UTC](https://www.agentica-lang.com/agentica/library/text-and-data/utc/index.md) (`std/utc`) to turn Unix milliseconds into the date and time in UTC and into RFC 3339 text.
- Use [URI](https://www.agentica-lang.com/agentica/library/text-and-data/uri/index.md) (`std/uri`) to percent-encode and decode URL components and to read and write query strings.
- Use the [OpenSSL builtins](https://www.agentica-lang.com/agentica/library/text-and-data/crypto/index.md) 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](https://www.agentica-lang.com/agentica/library/text-and-data/zlib/index.md) to compress bytes, files and streams with DEFLATE, zlib and gzip.
- Use [Base64 and hex](https://www.agentica-lang.com/agentica/library/text-and-data/base64/index.md) to write bytes as text and read them back.

The tour pages [Strings](https://www.agentica-lang.com/agentica/tour/strings/index.md) and [Numbers](https://www.agentica-lang.com/agentica/tour/numbers/index.md) are a short start.

## Pages in this section

- [String](https://www.agentica-lang.com/agentica/library/text-and-data/string/index.md): Functions for text. Each one is also a method on String values.
- [Int and Float](https://www.agentica-lang.com/agentica/library/text-and-data/numbers/index.md): Convert between Int, Float and String, round, clamp and other number helpers, and work on the bits of an Int or a Float.
- [JSON](https://www.agentica-lang.com/agentica/library/text-and-data/json/index.md): Encode values as JSON, decode JSON into structs, and read dynamic JSON.
- [Binary data (std)](https://www.agentica-lang.com/agentica/library/text-and-data/binary/index.md): The std/binary module, which reads and writes binary numbers in a Bytes.
- [TOML (std)](https://www.agentica-lang.com/agentica/library/text-and-data/toml/index.md): The std/toml module, which reads and writes TOML 1.0 documents.
- [OpenSSL](https://www.agentica-lang.com/agentica/library/text-and-data/crypto/index.md): The OpenSSL family of builtins. OpenSSL.Digest hashes bytes with MD5, SHA-1, SHA-256 and SHA-512, OpenSSL.HMAC signs bytes with a key and compares MACs in constant time, OpenSSL.Cipher encrypts with AES-256-GCM and Triple DES CBC, OpenSSL.KDF hashes passwords with PBKDF2 and scrypt, OpenSSL.CMAC gives the MACs of payment formats, OpenSSL.RSA encrypts with a public key, and OpenSSL.Random draws secure random bytes, hex and UUIDs.
- [Zlib](https://www.agentica-lang.com/agentica/library/text-and-data/zlib/index.md): The Zlib builtins and the Lazy steps, which compress bytes, files and streams with DEFLATE, zlib and gzip.
- [Base64 and hex](https://www.agentica-lang.com/agentica/library/text-and-data/base64/index.md): The Base64 and OpenSSL.Digest builtins, which write bytes as base64 or hex text and read them back.
- [URI (std)](https://www.agentica-lang.com/agentica/library/text-and-data/uri/index.md): The std/uri module, which percent-encodes and decodes URL components and query strings.
- [HTML (std)](https://www.agentica-lang.com/agentica/library/text-and-data/html/index.md): The std/html module, which escapes and unescapes HTML text.
- [Cookie (std)](https://www.agentica-lang.com/agentica/library/text-and-data/cookie/index.md): The std/cookie module, which reads a Cookie request header and writes a Set-Cookie response header.
- [EAG templates (std)](https://www.agentica-lang.com/agentica/library/text-and-data/eag/index.md): The `<<~EAG` template heredoc and the std/eag module that it needs.
- [MIME (std)](https://www.agentica-lang.com/agentica/library/text-and-data/mime/index.md): The std/mime module, which gives the media type of a file from its name and tells which types are text.
- [Regex (std)](https://www.agentica-lang.com/agentica/library/text-and-data/regex/index.md): The std/regex module, which searches, extracts, replaces and splits text with regular expressions in linear time.
- [UTC (std)](https://www.agentica-lang.com/agentica/library/text-and-data/utc/index.md): The std/utc module, which turns Unix milliseconds into the civil date and time in UTC and into RFC 3339 text.
