Welcome to YARGA!

Yet Another Random Generator API

Robert Sharp

Abstract

YARGA provides convenient access to high-performance thread local random value generators via its friendly API. This codebase is intended to be used as an introductory teaching tool and may not represent current best practices. For private use only, use with caution and void where prohibited!

Warning: The underlying random engine is not cryptographically secure and should not be used for security or secure hashing.

YARGA Tech Stack

  • RNG Engine: Fortuna for Java
  • Kotlin: JVM (Java 11)
  • Spring Boot: Maven
  • AWS: Elastic Beanstalk - Corretto 11

YARGA Endpoints

Canonical

  • Canonical() -> Double
  • Returns a random double precision floating point value
  • Distribution: Flat Uniform => Range[0.0..1.0) *tail exclusive
  • Method: GET
  • Response: JSON

One Die Roll

  • Die(sides: Int) -> Int
  • Returns a random integer
  • Distribution: Flat Uniform => Range[1..sides] *inclusive
  • Method: GET
  • Param `sides`: Size of die to be rolled. Default: 6
  • Response: JSON

Multi Dice Roll

  • Dice(rolls: Int sides: Int) -> Int
  • Returns a random integer
  • Distribution: Middle Geometric => Range[rolls..rolls*sides] *inclusive
  • Method: GET
  • Param `rolls`: Number of dice to be rolled. Default: 1
  • Param `sides`: Size of dice to be rolled. Default: 20
  • Response: JSON

Percent True

  • PercentTrue(chance: Int) -> Bool
  • Returns a random boolean
  • Distribution: Linear => Literal[true, false]
  • Method: GET
  • Param `chance`: Percent chance of returning true. Default: 50
  • Response: JSON