From 53d9902347dad9e22171f643916e830c1b20872c Mon Sep 17 00:00:00 2001 From: Antonis Geralis <43617260+planetis-m@users.noreply.github.com> Date: Thu, 29 Oct 2020 12:14:22 +0200 Subject: Make default state public (#15763) * Make default state public * Address review comments Co-authored-by: b3liever --- lib/pure/random.nim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/pure') diff --git a/lib/pure/random.nim b/lib/pure/random.nim index 7c5d51ceb..3d9948d08 100644 --- a/lib/pure/random.nim +++ b/lib/pure/random.nim @@ -119,6 +119,12 @@ else: a0: 0x69B4C98CB8530805u64, a1: 0xFED1DD3004688D67CAu64) # global for backwards compatibility +since (1, 5): + template randState*(): untyped = + ## Makes the default Rand state accessible from other modules. + ## Useful for module authors. + state + proc rotl(x, k: Ui): Ui = result = (x shl k) or (x shr (Ui(64) - k)) -- cgit 1.4.1-2-gfad0