# `locus_mmdb_data_codec`
[🔗](https://github.com/g-andrade/locus/blob/2.3.15/src/locus_mmdb_data_codec.erl#L24)

API for working with MMDB - data codec.

See [MaxMind DB File Format Specification](https://maxmind.github.io/MaxMind-DB/).

# `index`

```erlang
-type index() :: non_neg_integer().
```

# `parse_all`

```erlang
-spec parse_all(binary(), boolean()) -> [locus_mmdb_data:value() | locus_mmdb_data_raw:value()].
```

# `parse_on_index`

```erlang
-spec parse_on_index(Index, DataSection, Raw) -> {Value | RawValue, RemainingData}
                        when
                            Index :: index(),
                            DataSection :: binary(),
                            Raw :: boolean(),
                            Value :: locus_mmdb_data:value(),
                            RawValue :: locus_mmdb_data_raw:value(),
                            RemainingData :: binary().
```

Attempts to parse either the `Value` or `RawValue`
(depending on the `Raw` flag) at `Index` in `DataSection`.

Will crash upon invalid/unrecognized data, invalid pointers
or cyclic pointer chasing (i.e. loops.)

# `validate_indices_in_tree`

```erlang
-spec validate_indices_in_tree(locus_shared_bitarray:t(),
                               locus_shared_bitarray:t(),
                               locus_shared_bitarray:t(),
                               pos_integer(),
                               non_neg_integer(),
                               binary(),
                               locus_mmdb_check_journal:t()) ->
                                  ok.
```

---

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