#pragma once #include #include class Rng{ public: virtual uint32_t get()=0; virtual uint32_t get_uniform(uint32_t upbound)=0; }; class KeyRng : public Rng{ uint8_t *key; int keylen; int idx; uint64_t state; void stir(); public: KeyRng(const char *key,int keylen); explicit KeyRng(const std::string &key); KeyRng(const Rng&)=delete; //just keep it at one KeyRng please ~KeyRng(); uint32_t get(); uint32_t get_uniform(uint32_t upbound); }; class Arc4Rng : public Rng{ public: uint32_t get(); uint32_t get_uniform(uint32_t upbound); };