I'm porting lesspass password manager to powershell, but I'm having trouble when implementing the _consume_entropy() method, especially the Python divmod
.
Reproduce
PS> [bigint]$EntropyAsInt = 99600400399777174105034830393873797761817714609490038944205586760025858632478
PS> Write-Host $EntropyAsInt
99600400399777173995117538344184441997741701018199539534149245151907290284032
Difference
99600400399777174105034830393873797761817714609490038944205586760025858632478
99600400399777173995117538344184441997741701018199539534149245151907290284032
^ start diverging he
Question
What's the matter here? Am I using the wrong type?
99600400399777174105034830393873797761817714609490038944205586760025858632478
is a[Double]
...By the time it gets cast to
[BigInt]
the original value is already lost. Starting with a[String]
preserves it, though...See Instantiating a BigInteger Object for more information.