Updated getrng() to take an optional seed.