# Hash functions now accept an option set · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/fc55cd458a7cd72ea876cf747b1ddd43d8dc6e20)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: fc55cd458a7cd72ea876cf747b1ddd43d8dc6e20

Requested commit: fc55cd458a7cd72ea876cf747b1ddd43d8dc6e20

Commit: fc55cd458a7cd72ea876cf747b1ddd43d8dc6e20

Tree: 421c3e4036ac5288aa9312d4af68608884f8dae1

Author: Frank Denis

Committer: Frank Denis

## Message

```
Hash functions now accept an option set

- This avoids having multiple `init()` functions for every combination
of optional parameters
- The API is consistent across all hash functions
- New options can be added later without breaking existing applications.
  For example, this is going to come in handy if we implement parallelization
  for BLAKE2 and BLAKE3.
- We don't have a mix of snake_case and camelCase functions any more, at
least in the public crypto API

Support for BLAKE2 salt and personalization (more commonly called context)
parameters have been implemented by the way to illustrate this.

```

## Parents

- [adf3d00e874275557b69ef65164a2b2a0dd88167](https://git.cafe/gitcafe/zig/commit/adf3d00e874275557b69ef65164a2b2a0dd88167?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/fc55cd458a7cd72ea876cf747b1ddd43d8dc6e20?format=markdown)
