Source Code

This “extras” package provides the following utilities to complement ceylon.random:

  • platformRandom(): Returns an instance of Random that delegates the platform default random number generator.
  • platformSecureRandom(): Returns an instance of Random that delegates the platform default secure random number generator, or null if a secure random number generator is not available.
By: John Vasileff
License: http://opensource.org/licenses/MIT
Packages
com.vasileff.ceylon.random.extras
Dependencies
ceylon.random1.2.2
dart.math (dart)1.2.2
java.base (jvm)8
Functions
platformRandomSource Codeshared Random platformRandom()

Returns an instance of Random backed by a platform specific random number generator.

For the JVM, this function returns a Random that uses java.util.Random for random values.

For the JavaScript VM, this function returns a Random that uses Math.random() for random values.

platformSecureRandomSource Codeshared Random? platformSecureRandom()

Returns an instance of Random backed by a platform specific secure random number generator.

For the JVM, this function returns a Random that uses java.security.SecureRandom for random values.

For the JavaScript VM, this function returns null.