{"_id":"probity","_rev":"37-1c07706ecf54258f6c4d5ac76a3d4d75","name":"probity","dist-tags":{"latest":"1.2.20"},"versions":{"1.2.14":{"name":"probity","version":"1.2.14","keywords":["casino","slot","slots","reels","math","combination","igaming","rtp","rgs","gaming","gaming service","mathematician","mathematical"],"author":{"name":"Serge P."},"license":"ISC","_id":"probity@1.2.14","maintainers":[{"name":"pserge","email":"serge@polishchuk.com"}],"dist":{"shasum":"6153d012af48c1a9d32d0d57f12dcc7c0dc8d3aa","tarball":"https://registry.npmjs.org/probity/-/probity-1.2.14.tgz","fileCount":7,"integrity":"sha512-lJy83EkwWsDnBtjtXqNUVOoTptUSIsw3fsalkg25Ktq34mLeZGl8qSZskuvjcEWAbiVbyKJI2+35dFavDw7zUw==","signatures":[{"sig":"MEUCIEJ7DzWOUPl4vSlOpwL20Tc6dNrPsXlWbgyUi4t17qnzAiEArDl1/+LfR7RCqM3gKRg1P3nHUyO38eqXLBN2p0blefg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1125495},"main":"src/index.js","gypfile":true,"scripts":{"install":"node-gyp rebuild"},"_npmUser":{"name":"pserge","email":"serge@polishchuk.com"},"_npmVersion":"10.9.2","description":"Combination generator for slots. Strong RNG inside. RTP control. A lot of game features available.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"node-addon-api":"^7.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/probity_1.2.14_1779474423539_0.06323280653423446","host":"s3://npm-registry-packages-npm-production"}},"1.2.15":{"name":"probity","version":"1.2.15","keywords":["casino","slot","slots","reels","math","combination","igaming","rtp","rgs","gaming","gaming service","mathematician","mathematical","api-client"],"author":{"name":"Serge P."},"license":"ISC","_id":"probity@1.2.15","maintainers":[{"name":"pserge","email":"serge@polishchuk.com"}],"dist":{"shasum":"04c812aa30e9a17091b95135364937a0dd78bacb","tarball":"https://registry.npmjs.org/probity/-/probity-1.2.15.tgz","fileCount":7,"integrity":"sha512-SrZNYCqRuSVS5bYv0i20QZxVvjvfV+qtZeDplAsyuaN79vt31Ul42eZT7TKaqIS/MlmkGWXsrHfuwzJrO114xg==","signatures":[{"sig":"MEQCIC1Ug8TZy5TeunfAsQUqtLEflD3kxeP1V/gBHtZpwTkTAiAs/HvQtIrsGcPQmEIz3VHR/3p6Hsl22VyDUvyTQ9waCw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1142289},"main":"src/index.js","gypfile":true,"scripts":{"install":"node-gyp rebuild"},"_npmUser":{"name":"pserge","email":"serge@polishchuk.com"},"_npmVersion":"10.9.2","description":"Combination generator for slots. Strong RNG inside. RTP control. A lot of game features available.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"node-addon-api":"^7.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/probity_1.2.15_1780050718577_0.7166308321501302","host":"s3://npm-registry-packages-npm-production"}},"1.2.16":{"name":"probity","version":"1.2.16","keywords":["casino","slot","slots","reels","math","combination","igaming","rtp","rgs","gaming","gaming service","mathematician","mathematical","api-client"],"author":{"name":"Serge P."},"license":"ISC","_id":"probity@1.2.16","maintainers":[{"name":"pserge","email":"serge@polishchuk.com"}],"dist":{"shasum":"2c9d710702be9916e6f07496bac600e00156afe7","tarball":"https://registry.npmjs.org/probity/-/probity-1.2.16.tgz","fileCount":7,"integrity":"sha512-M1OUV/DnRiw76tAQu1MOKiXuRSF1F4okk61sjZZqJija9RCH+2ci87dOWNPYIojESCrwExs+btCHWaZwxhIO8A==","signatures":[{"sig":"MEYCIQC71pCadv/AUwEHdohGgDdIPI490ej1xUijlsrC3nvoWwIhAMEfhT47Av/DQUDxN3gPGxAtZAb+uU0q0J9P3ZLdP1wn","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1142801},"main":"src/index.js","gypfile":true,"scripts":{"install":"node-gyp rebuild"},"_npmUser":{"name":"pserge","email":"serge@polishchuk.com"},"_npmVersion":"10.9.2","description":"Combination generator for slots. Strong RNG inside. RTP control. A lot of game features available.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"node-addon-api":"^7.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/probity_1.2.16_1780252727154_0.32944011365010506","host":"s3://npm-registry-packages-npm-production"}},"1.2.17":{"name":"probity","version":"1.2.17","keywords":["casino","slot","slots","reels","math","combination","igaming","rtp","rgs","gaming","gaming service","mathematician","mathematical","api-client"],"author":{"name":"Serge P."},"license":"ISC","_id":"probity@1.2.17","maintainers":[{"name":"pserge","email":"serge@polishchuk.com"}],"dist":{"shasum":"ad77ef4ee97755090e85135158cc9369e27713b4","tarball":"https://registry.npmjs.org/probity/-/probity-1.2.17.tgz","fileCount":7,"integrity":"sha512-/rfuaKseMV8dCUBnSJ3i/UfOem+TiUKvhZewOQ71Pxf23Xq4YN4vBWI3FH/Wb6D1AYpDkdNUzTNDHdmrafA6iQ==","signatures":[{"sig":"MEQCIHLzIGHWwNU4606WRuvyMts3UV/wouNK+S4XOVP+IO99AiAh0bGu6hgI3OCezkzWSpdVCAYV5gZsravDFRW6vjzj4g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1142861},"main":"src/index.js","gypfile":true,"scripts":{"install":"node-gyp rebuild"},"_npmUser":{"name":"pserge","email":"serge@polishchuk.com"},"_npmVersion":"10.9.2","description":"Combination generator for slots. Strong RNG inside. RTP control. A lot of game features available.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"node-addon-api":"^7.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/probity_1.2.17_1780314031331_0.17636799347374899","host":"s3://npm-registry-packages-npm-production"}},"1.2.18":{"name":"probity","version":"1.2.18","keywords":["casino","slot","slots","reels","math","combination","igaming","rtp","rgs","gaming","gaming service","mathematician","mathematical","api-client"],"author":{"name":"Serge P."},"license":"ISC","_id":"probity@1.2.18","maintainers":[{"name":"pserge","email":"serge@polishchuk.com"}],"dist":{"shasum":"71161837dc8e1cd8749be77c6bb0ef67b702a257","tarball":"https://registry.npmjs.org/probity/-/probity-1.2.18.tgz","fileCount":7,"integrity":"sha512-bVujLiN0OCymChOmH2abEvDvfJQj8LtoPokRnZYFLvoUO9lly+JtY8IN8NJBucSZynZpj+mEwGdudMpP3IFKtA==","signatures":[{"sig":"MEYCIQD+eQYW6PPx+d4XndkNCQIyhmxhOg+g3q9oqWakSmedNAIhAKGqE+KKM3OUpCYBDPSLKVhxO2SeMbKzglZdPARZXoXp","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1142861},"main":"src/index.js","gypfile":true,"scripts":{"install":"node-gyp rebuild"},"_npmUser":{"name":"pserge","email":"serge@polishchuk.com"},"_npmVersion":"10.9.2","description":"Combination generator for slots. Strong RNG inside. RTP control. A lot of game features available.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"node-addon-api":"^7.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/probity_1.2.18_1780508691939_0.17972004980316725","host":"s3://npm-registry-packages-npm-production"}},"1.2.19":{"name":"probity","version":"1.2.19","keywords":["casino","slot","slots","reels","math","combination","igaming","rtp","rgs","gaming","gaming service","mathematician","mathematical","api-client"],"author":{"name":"Serge P."},"license":"ISC","_id":"probity@1.2.19","maintainers":[{"name":"pserge","email":"serge@polishchuk.com"}],"dist":{"shasum":"8647c9a1081d9bb68fe08053f3d9c9c9b899185f","tarball":"https://registry.npmjs.org/probity/-/probity-1.2.19.tgz","fileCount":6,"integrity":"sha512-rVteR4GgKQx2ZgccQkZOCDAafKysdMKhoQo5Jbi6+sdXysqk9ywioYV6FXuIJHBoccl6gabmss7kW/5/yVYVPA==","signatures":[{"sig":"MEYCIQCbBtFa9UWi5ioStdJxaoWE26tMGfeI8Sw/YK4RwnsM9AIhAP0IjIzNnunS2t4SfHO79vmycmFZlflgIRyQd2WfgzKH","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1877506},"main":"probity.js","scripts":{},"_npmUser":{"name":"pserge","email":"serge@polishchuk.com"},"_npmVersion":"10.9.2","description":"Combination generator for slots. Strong RNG inside. RTP control. A lot of game features available.","directories":{},"_nodeVersion":"22.16.0","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/probity_1.2.19_1780647819425_0.21873419200126443","host":"s3://npm-registry-packages-npm-production"}},"1.2.20":{"name":"probity","version":"1.2.20","main":"probity.js","scripts":{},"keywords":["casino","slot","slots","reels","math","combination","igaming","rtp","rgs","gaming","gaming service","mathematician","mathematical","api-client"],"author":{"name":"Serge P."},"license":"ISC","description":"Combination generator for slots. Strong RNG inside. RTP control. A lot of game features available.","dependencies":{},"_id":"probity@1.2.20","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-GxcJUQGqBzAD9qvArH0K4lN/tt7JzoQ9ZguVpKCR8GzYydXVc4WdRXI3TxhPA/Lb+gXl+lzaoqDgovT4JgybnQ==","shasum":"66fcdb38559ce3a5d59d1bec173fbdf0f5d7b378","tarball":"https://registry.npmjs.org/probity/-/probity-1.2.20.tgz","fileCount":6,"unpackedSize":1877464,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDlX3HiH69MIY5AwJvGuYPXPVXxiZvp94lzTSfQMpgUDQIhAL1Qk50hBGBSJK89SsQp3oA8fXAXNBCLzC3w5aUoDGkk"}]},"_npmUser":{"name":"pserge","email":"serge@polishchuk.com"},"directories":{},"maintainers":[{"name":"pserge","email":"serge@polishchuk.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/probity_1.2.20_1780648022033_0.14427453592154338"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-30T19:35:44.516Z","modified":"2026-06-05T08:27:02.376Z","10.0.0":"2014-04-05T15:53:19.080Z","1.2.0":"2026-03-30T19:35:44.779Z","1.2.1":"2026-03-30T19:48:42.535Z","1.2.2":"2026-03-30T19:56:05.150Z","1.2.3":"2026-03-30T19:59:08.900Z","1.2.4":"2026-03-30T20:08:51.888Z","1.2.5":"2026-03-31T20:25:14.298Z","1.2.6":"2026-03-31T20:37:50.967Z","1.2.7":"2026-03-31T21:11:45.845Z","1.2.8":"2026-03-31T21:27:41.639Z","1.2.9":"2026-04-01T09:10:10.496Z","1.2.10":"2026-04-01T09:12:21.938Z","1.2.11":"2026-04-10T16:12:15.941Z","1.2.12":"2026-04-12T10:16:40.666Z","1.2.14":"2026-05-22T18:27:03.708Z","1.2.15":"2026-05-29T10:31:58.787Z","1.2.16":"2026-05-31T18:38:47.302Z","1.2.17":"2026-06-01T11:40:31.504Z","1.2.18":"2026-06-03T17:44:52.194Z","1.2.19":"2026-06-05T08:23:39.597Z","1.2.20":"2026-06-05T08:27:02.278Z"},"author":{"name":"Serge P."},"license":"ISC","keywords":["casino","slot","slots","reels","math","combination","igaming","rtp","rgs","gaming","gaming service","mathematician","mathematical","api-client"],"description":"Combination generator for slots. Strong RNG inside. RTP control. A lot of game features available.","maintainers":[{"name":"pserge","email":"serge@polishchuk.com"}],"readme":"# probity\r\n\r\nLightweight, reliable and fast generator of combinations for slot games.  \r\nStrong RNG is used under the hood.  \r\n\r\n# The basics\r\n\r\nAll operations are synchronous.  \r\nFor high-loaded projects it's recommended to run several probity modules simultaneously.  \r\nThe module should always be loaded, and process requests from clients as they arrive.  \r\nYou may set up a simple HTTP server for that, for example.  \r\nThe library may be encapsulated to C/C++, Java etc.  \r\n\r\n## Overview\r\n\r\nProbity is a high-performance slot combination generator.  \r\nSee how it works [here](https://github.com/srgpl/slotmath).\r\n\r\n## System requirements\r\n\r\n- linux or windows operation system\r\n- intel/amd x64 processor  \r\n\r\n\r\n# API\r\n\r\nThe module exports the only method:\r\n\r\n## action ( request )\r\nExecutes the action.  \r\n`request` is expected to be JSON.  \r\nThe return value is JSON as well.\r\n\r\n## is_loaded\r\nThis property sets to `true` if the module was successfully loaded previously.\r\n\r\n\r\n# Protocol description\r\n\r\nGeneral rule is:  \r\nRequest always has the following structure:\r\n\r\n```\r\n{\t\"action\": \"action_name\"\r\n\t... some other parameters ...\r\n}\r\n```\r\n\r\nReply always looks like this:\r\n\r\n```\r\n{\t\"request\": {\r\n\t\t... request json ...\r\n\t},\r\n\t\"success\": true\r\n\t... some other data ...\r\n}\r\n```\r\n\r\nor\r\n\r\n```\r\n{\t\"error\": 3\r\n}\r\n```\r\n\r\nSee possible error codes below.\r\n\r\n## set_configuration\r\n\r\n```\r\n{\t\"action\": \"set_configuration\",\r\n\t\"log\": {\r\n\t\t\"file\": \"/path/to/file.log\",\r\n\t\t\"stdout\": true\r\n\t},\r\n\t\"staging\": true\r\n}\r\n```\r\n\r\n`log.file` is file for log storage. Specify `null` or skip it if log should not be stored.  \r\n`log.stdout` is true to print error messages to stdout.\r\n`staging` is true to allow `test` feature in `get_combination`.\r\n\r\nexpected reply:\r\n\r\n```\r\n{\t\"success\": true\r\n}\r\n```\r\n\r\n## set_game_definition\r\n\r\n```\r\n{\t\"action\": \"set_game_definition\",\r\n\t\"game_id\": \"\",\r\n\t\"definition\": \"\"\r\n}\r\n```\r\n\r\n`game_id` is unique game id string  \r\n`definition` is game definition string  \r\n\r\nexpected reply:\r\n\r\n```\r\n{\t\"success\": true\r\n}\r\n```\r\n\r\n\r\n## select_game\r\n\r\n```\r\n{\t\"action\": \"select_game\",\r\n\t\"game_id\": \"\",\r\n\t\"session_id\": \"\",\r\n\t\"session_data\": \"\"\r\n}\r\n```\r\n\r\n`game_id` is game id string  \r\n`session_id` some unique string used to distinguish player sessions  \r\n`session_data` player session data string  \r\n\r\nIt's important to save and restore player session data between sessions.  \r\nSome games use it to keep the context of the game.\r\n\r\nexpected reply:\r\n\r\n```\r\n{\t\"success\": true\r\n\t\"game\" : {\r\n\t\t...\r\n\t}\r\n\t\"combination\": {\r\n\t\t...\r\n\t}\r\n}\r\n```\r\n\r\n`game` is the paytable of the game selected.  \r\n`combination` is the combination the player got in the previous session.\r\n\r\n\r\n## get_combination\r\n\r\n```\r\n{\t\"action\": \"get_combination\",\r\n\t\"session_id\": \"\",\r\n\t\"bet_sum\": 9.95\r\n}\r\n```\r\n\r\n`session_id` is player session id  \r\n`bet_sum` is bet sum  \r\n`test` optional reels array to be used instead of generating them.  \r\n\r\nTest reels are used for game development to explore different game situations.  \r\nYou should disable this feature in production mode.  \r\n\r\n```\r\n{\t\"success\": true,\r\n\t\"combination\": {\r\n\t\t\"reels\": [\r\n\t\t\t...\r\n\t\t],\r\n\t\t\"events\": [\r\n\t\t\t{ ... },\r\n\t\t\t{ ... },\r\n\t\t\t{ ... }\r\n\t\t\t  ...\r\n\t\t],\r\n\t\t\"actual\": {\r\n\t\t\t\"bet\": 9.95,\r\n\t\t\t\"win\": 15.50,\r\n\t\t}\r\n\t}\r\n}\r\n```\r\n\r\n`combination` is the combination generated with all the winning results (if any).  \r\n`combination.reels` are the reels randomly generated.  \r\n`combination.events` is an array of objects, where every object is a game event occured.  \r\n`combination.actual.bet` is actual bet sum that must be deducted from player balance.  \r\n`combination.actual.win` is actual win sum that must be added to player balance.  \r\n\r\n## get_session_data\r\n\r\n```\r\n{\t\"action\": \"get_session_data\",\r\n\t\"session_id\": \"\"\r\n}\r\n```\r\n\r\n`session_id` is player session id\r\n\r\nThis requests player session data.  \r\nIt's recommended to request and store it after every bet.  \r\n\r\nexpected reply:\r\n\r\n```\r\n{\t\"success\": true,\r\n\t\"session_data\": \"session data string\"\r\n}\r\n```\r\n\r\n## get_game_list\r\n\r\n```\r\n{\t\"action\": \"get_game_list\"\r\n}\r\n```\r\n\r\nThis returns list of available games previously set with `set_game_definition`.  \r\n\r\nexpected reply:\r\n\r\n```\r\n{\t\"success\": true,\r\n\t\"game_list\": [\r\n\t\t\"first_game_id\",\r\n\t\t\"second_game_id\",\r\n\t\t\"and so on\"\r\n\t]\r\n}\r\n```\r\n\r\n# Possible use case\r\n\r\nPossible and recommended scenario of using probity:\r\n\r\n1. app probity package to your project: `npm i probity`  \r\n2. send `set_configuration` to initialize it  \r\n3. send `set_game_definition` several times to load games  \r\n--  \r\n4. wait for player  request(s)  \r\n5. player selects the game with `select_game`  \r\n6. player generates the combinations with `get_combination`  \r\n7. player session is stored using `get_session_data`  \r\n8. goto 4  \r\n\r\nSteps 1-3 are executed only once at the beginning.  \r\nSteps 4-8 are repeated many times for every player.  \r\nAll players must have unique session ids.\r\n\r\n# Error codes\r\n\r\n1: unexpected (unknown) error  \r\n2: json is broken  \r\n3: incorrect action   \r\n4: action can not be completed  \r\n5: wrong request, incorrect parameter  \r\n6: api key is incorrect  \r\n7: game definition is incorrect  \r\n8: player session id not found or incorrect  \r\n9: player session data is incorrect  \r\n10: unknown game  \r\n11: error generating combination  \r\n\r\n# Example\r\n\r\nSome examples can be found [here](https://github.com/srgpl/slotmath).\r\n","readmeFilename":"README.md"}