{"id":"tim7775/debug-random","name":"debug-random","scope":"tim7775","platform":"roblox","description":"A wrapper around Roblox's Random class that enables users to serialize and set the state of the Random object","version":"1.0.3","latest":"1.0.3","versions":["1.0.0","1.0.1","1.0.2","1.0.3"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{},"integrity":"f0eaed15f5ea841c4dde3e3957b53b626993a3d61e98e53761b7c86cf842b22f","likes":0,"downloads":0,"install":"forest install tim7775/debug-random","url":"https://forest.dev/p/roblox/tim7775/debug-random","files":"https://api.forest.dev/ai/package/roblox/tim7775/debug-random/files","readme":"# DebugRandom\n\nA wrapper around Roblox's [Random](https://create.roblox.com/docs/reference/engine/datatypes/Random) class that enables users to serialize and set the state of the Random object.\n\nGet it here:\n\n- [Wally](https://wally.run/package/tim7775/debug-random)\n- [Releases](https://github.com/Tim7775/DebugRandom/releases)\n- [Npm (Roblox-ts)](https://www.npmjs.com/package/@rbxts/debug-random)\n\n<!--moonwave-hide-after-this-line-->\n\n## Documentation\n\n[View Documentation](https://tim7775.github.io/DebugRandom/api/DebugRandom)\n\n<!--moonwave-hide-before-this-line-->\n\n## Usage\n\n**Example use:** Serialize a random number generator's state when an error occurs, so the error can be replicated using [DebugRandom:SetSerializedState](https://tim7775.github.io/DebugRandom/api/DebugRandom#SetSerializedState) or [DebugRandom.deserialize](https://tim7775.github.io/DebugRandom/api/DebugRandom#deserialize).\n\n```lua\nlocal rng = DebugRandom.new()\nprint(rng:NextNumber())\n\nlocal state = rng:Serialize()\nlocal deserializedRng = DebugRandom.deserialize(state)\nassert(rng == deserializedRng)\nassert(rng:NextNumber() == deserializedRng:NextNumber())\nassert(rng == DebugRandom.fromString(tostring(rng)))\n```\n","readmeTruncated":false}