# std.rand.Random: add enumValue\(\) \(\#9583\) · gitcafe/zig

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

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

Visibility: public

Requested revision: 62fe4a0ba8a08b9477e772841d3ae128937f0752

Requested commit: 62fe4a0ba8a08b9477e772841d3ae128937f0752

Commit: 62fe4a0ba8a08b9477e772841d3ae128937f0752

Tree: 763f892c896ceac7e45e6ba3408ccede4116a0e2

Author: Justin Whear

Committer: GitHub

## Message

```
std.rand.Random: add enumValue() (#9583)

* add Random.enumValue()

* edits suggested by review

* applied zig fmt

* Rewrite to use std.enums.values

Implemented pfgithub's suggestion to rewrite against this function, greatly simplifying the implementation.

Co-authored-by: Justin Whear <justin@economicmodeling.com>
```

## Parents

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

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