# RIFF
This is an Elixir module for reading [RIFF](https://en.wikipedia.org/wiki/Resource_Interchange_File_Format) and writing files.
## Example
```
> riff = File.read!("foo.webp")
<<82, 73, 70, 70, 192, 199 ...>>
> parsed = RIFF.parse(riff)
%RIFF.ChunkWithSubChunks{
id: "RIFF",
size: 51136,
format: "WEBP",
sub_chunks: [
%RIFF.Chunk{
id: "VP8L",
size: 51123,
data: <<47 ...>>
}
]
}
> RIFF.find_chunk(parsed, "VP8L")
%RIFF.Chunk{
id: "VP8L",
size: 51123,
data: <<47 ...>>
}
> data = RIFF.encode(parsed)
<<82, 73, 70, 70, 192, 199 ...>>
```
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `riff` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:riff, "~> 0.1.0"}
]
end
```
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at <https://hexdocs.pm/riff>.