npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

probity

v1.2.20

Published

Combination generator for slots. Strong RNG inside. RTP control. A lot of game features available.

Readme

probity

Lightweight, reliable and fast generator of combinations for slot games.
Strong RNG is used under the hood.

The basics

All operations are synchronous.
For high-loaded projects it's recommended to run several probity modules simultaneously.
The module should always be loaded, and process requests from clients as they arrive.
You may set up a simple HTTP server for that, for example.
The library may be encapsulated to C/C++, Java etc.

Overview

Probity is a high-performance slot combination generator.
See how it works here.

System requirements

  • linux or windows operation system
  • intel/amd x64 processor

API

The module exports the only method:

action ( request )

Executes the action.
request is expected to be JSON.
The return value is JSON as well.

is_loaded

This property sets to true if the module was successfully loaded previously.

Protocol description

General rule is:
Request always has the following structure:

{	"action": "action_name"
	... some other parameters ...
}

Reply always looks like this:

{	"request": {
		... request json ...
	},
	"success": true
	... some other data ...
}

or

{	"error": 3
}

See possible error codes below.

set_configuration

{	"action": "set_configuration",
	"log": {
		"file": "/path/to/file.log",
		"stdout": true
	},
	"staging": true
}

log.file is file for log storage. Specify null or skip it if log should not be stored.
log.stdout is true to print error messages to stdout. staging is true to allow test feature in get_combination.

expected reply:

{	"success": true
}

set_game_definition

{	"action": "set_game_definition",
	"game_id": "",
	"definition": ""
}

game_id is unique game id string
definition is game definition string

expected reply:

{	"success": true
}

select_game

{	"action": "select_game",
	"game_id": "",
	"session_id": "",
	"session_data": ""
}

game_id is game id string
session_id some unique string used to distinguish player sessions
session_data player session data string

It's important to save and restore player session data between sessions.
Some games use it to keep the context of the game.

expected reply:

{	"success": true
	"game" : {
		...
	}
	"combination": {
		...
	}
}

game is the paytable of the game selected.
combination is the combination the player got in the previous session.

get_combination

{	"action": "get_combination",
	"session_id": "",
	"bet_sum": 9.95
}

session_id is player session id
bet_sum is bet sum
test optional reels array to be used instead of generating them.

Test reels are used for game development to explore different game situations.
You should disable this feature in production mode.

{	"success": true,
	"combination": {
		"reels": [
			...
		],
		"events": [
			{ ... },
			{ ... },
			{ ... }
			  ...
		],
		"actual": {
			"bet": 9.95,
			"win": 15.50,
		}
	}
}

combination is the combination generated with all the winning results (if any).
combination.reels are the reels randomly generated.
combination.events is an array of objects, where every object is a game event occured.
combination.actual.bet is actual bet sum that must be deducted from player balance.
combination.actual.win is actual win sum that must be added to player balance.

get_session_data

{	"action": "get_session_data",
	"session_id": ""
}

session_id is player session id

This requests player session data.
It's recommended to request and store it after every bet.

expected reply:

{	"success": true,
	"session_data": "session data string"
}

get_game_list

{	"action": "get_game_list"
}

This returns list of available games previously set with set_game_definition.

expected reply:

{	"success": true,
	"game_list": [
		"first_game_id",
		"second_game_id",
		"and so on"
	]
}

Possible use case

Possible and recommended scenario of using probity:

  1. app probity package to your project: npm i probity
  2. send set_configuration to initialize it
  3. send set_game_definition several times to load games
    --
  4. wait for player request(s)
  5. player selects the game with select_game
  6. player generates the combinations with get_combination
  7. player session is stored using get_session_data
  8. goto 4

Steps 1-3 are executed only once at the beginning.
Steps 4-8 are repeated many times for every player.
All players must have unique session ids.

Error codes

1: unexpected (unknown) error
2: json is broken
3: incorrect action
4: action can not be completed
5: wrong request, incorrect parameter
6: api key is incorrect
7: game definition is incorrect
8: player session id not found or incorrect
9: player session data is incorrect
10: unknown game
11: error generating combination

Example

Some examples can be found here.