X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/f9bf01c6616d5ddcf65b13b33cedf9e387ff7a63..93a3786624b2768d89bfa27e46598dc64e2fb70a:/runtime/WeakRandom.h?ds=sidebyside diff --git a/runtime/WeakRandom.h b/runtime/WeakRandom.h index ff3995e..3cd1016 100644 --- a/runtime/WeakRandom.h +++ b/runtime/WeakRandom.h @@ -62,12 +62,20 @@ public: , m_high(seed) { } + + // Returns the seed provided that you've never called get() or getUint32(). + unsigned seedUnsafe() const { return m_high; } double get() { return advance() / (UINT_MAX + 1.0); } + unsigned getUint32() + { + return advance(); + } + private: unsigned advance() {