# `Unit.Information`
[🔗](https://github.com/harmont-dev/hyper/blob/main/lib/unit/information.ex#L1)

A quantity of data, stored canonically in bytes. Build with `bytes/1` or the
binary-prefix constructors (`kib/1`, `mib/1`, `gib/1`, `tib/1`); read back with
the matching `as_*` accessor. Arithmetic (`+`, `-`) and comparison
(`<`, `>`, `<=`, `>=`) come from `Unit.Operators`.

# `t`

```elixir
@opaque t()
```

# `as_bytes`

```elixir
@spec as_bytes(t()) :: integer()
```

# `as_gib`

```elixir
@spec as_gib(t()) :: integer()
```

# `as_mib`

```elixir
@spec as_mib(t()) :: integer()
```

# `as_sectors`

```elixir
@spec as_sectors(t()) :: integer()
```

The quantity in whole 512-byte sectors.

# `bytes`

```elixir
@spec bytes(integer()) :: t()
```

# `gib`

```elixir
@spec gib(integer()) :: t()
```

# `kib`

```elixir
@spec kib(integer()) :: t()
```

# `mib`

```elixir
@spec mib(integer()) :: t()
```

# `parse`

```elixir
@spec parse(String.t()) :: {:ok, t()} | {:error, {:bad_unit, String.t()}}
```

Parse a string like `"4GiB"` into an `Information`. Suffixes: B/KiB/MiB/GiB/TiB.

# `parse!`

```elixir
@spec parse!(String.t()) :: t()
```

Like `parse/1` but raises `ArgumentError` on bad input.

# `sectors`

```elixir
@spec sectors(integer()) :: t()
```

`v` 512-byte disk sectors — the kernel's universal block-device unit.

# `tib`

```elixir
@spec tib(integer()) :: t()
```

# `zero`

```elixir
@spec zero() :: t()
```

The zero quantity (additive identity).

---

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