cross-platform rng
merged