# `QuakeServer.Extensions.Encoding`
[🔗](https://github.com/jaman/quake_server/blob/v0.1.0/lib/quake_server/extensions/encoding.ex#L1)

FTE's builtins that recode text and bytes:

  * `strconv` (224) — case (1 lower, 2 upper) and Quake's red and white character
    sets for letters, digits and punctuation, as FTE's `PF_strconv`
  * `strlennocol` (476), `strdecolorize` (477) — length and text with markup removed
    (`QuakeServer.Markup`, by `com_parseutf8`, `ezcompat_markup`, `dpcompat_console`)
  * `crc16` (494) — Quake's CRC-16 (CCITT, from 0xFFFF) of the arguments joined, case
    folded when the first argument is set
  * `uri_escape` (510), `uri_unescape` (511) — percent encoding of every byte but
    RFC 3986's unreserved ones, and back
  * `argescape` (295) — a string quoted for the console as FTE's `COM_QuotedString`
  * `digest_hex` (639), `digest_ptr` — a hex digest (`MD4`, `MD5`, `SHA1`, `SHA2-224`
    or `SHA224` and the 256, 384 and 512 ones likewise, `CRC16` little end first) of
    the arguments joined or of bytes in memory; null for another name
  * `base64encode`, `base64decode` — bytes in memory to base 64, and base 64 to a new
    block of memory (its length written to the second argument)
  * `ftou`, `utof` — a float to an unsigned integer, and back with an optional shift and
    bit count

# `call`

```elixir
@spec call(map(), integer() | String.t(), non_neg_integer()) :: map()
```

Run recoding builtin `builtin` (a number or a name).

# `crc16`

```elixir
@spec crc16(binary()) :: non_neg_integer()
```

Quake's CRC-16 of `data`: CCITT's polynomial 0x1021, starting from 0xFFFF.

# `quoted`

```elixir
@spec quoted(String.t(), boolean()) :: String.t()
```

Text quoted for the console as FTE's `COM_QuotedString`, escaped when it holds a newline or a quote.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
