# Copyright 2005-2007 Kevin Reid, under the terms of the MIT X license # found at http://www.opensource.org/licenses/mit-license.html ................ pragma.syntax("0.9") def swissSizeInOctets :int := 20 def swissUpperBound :int := 2 ** (8 * swissSizeInOctets) /** Wrap a CL:RANDOM-STATE object so as to hide its state. */ def wrapRandomState(randomState) implements DeepFrozen, ExitViaHere { trace("WARNING: privilegedScope entropy is not yet high-quality") return def wrappedRandomState { to __printOn(out :TextWriter) { out.write("") } to nextInt(range :int) :int { return randomState.nextInt(range) } to nextSwiss() :int { return randomState.nextInt(swissUpperBound) } } }