thomcc / pcg-random

PCG RNG for JavaScript
32 stars 7 forks source link

Fix BigInt seeding #4

Closed felipeochoa closed 2 years ago

felipeochoa commented 2 years ago

The issue can be reproduced with:

const PcgRandom = require("pcg-random")

const r = new PcgRandom();

r.setSeed(BigInt('1'), BigInt('1'));

Currently seedLo & bU32Max is a TypeError since bU32Max is only defined later

thomcc commented 2 years ago

Nevermind, I'll just do it now.

thomcc commented 2 years ago

Published in v2.0.1: https://www.npmjs.com/package/pcg-random/v/2.0.1

Thanks for the contribution.

felipeochoa commented 2 years ago

Sorry about the slow reply, but thanks for merging! Not sure if it's need it for anything, but FYI there's currently no 2.0.1 release on github

thomcc commented 2 years ago

Oh, sorry. I did remember to tag it when I did so (see https://github.com/thomcc/pcg-random/tags), which seemed like enough. I'm pretty good at remembering to tag releases of libraries, but it's mainly just for signing and verification reasons. I suppose releases would send out notifications and are slightly easier to notice, though.

Do you think it's worth turning the tag into a release? I don't really write JS anymore (I'm all-in on Rust at this point, lol), so I don't know what people care about (for example, do the releases/relnotes appear somewhere on NPM now?)