Created
March 11, 2020 16:33
-
-
Save IISResetMe/93d1699c6ebf856add68cd200f697894 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class LCG | |
| { | |
| hidden [long] | |
| $factor = 1140671485 | |
| hidden [long] | |
| $offset = 12820163 | |
| hidden [long] | |
| $modulus = 16777216 | |
| [long] | |
| $Seed | |
| LCG() | |
| { | |
| $this.Seed = Get-Random | |
| } | |
| LCG([long]$seed) | |
| { | |
| $this.Seed = $seed | |
| } | |
| [long] | |
| Next(){ | |
| return ($this.Seed = ($this.factor * $this.Seed + $this.offset) % $this.modulus) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.