#ifndef DECK_RNG_H
#define DECK_RNG_H

#include <stdint.h>

typedef struct {
  uint64_t state;
} RngState;

/* FNV-1a 64-bit hash of a NUL-terminated string. */
uint64_t rng_seed_from_string(const char *seed);

void rng_init(RngState *rng, uint64_t seed);

/* splitmix64 stream. Pure integer arithmetic so the sequence is identical
 * on every platform this engine runs on, including the watch later. */
uint64_t rng_next_u64(RngState *rng);

/* Uniform value in [0, bound). bound must be > 0. */
uint32_t rng_next_bounded(RngState *rng, uint32_t bound);

#endif
