PHPackages                             appengine-ltd/ticket-picker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. appengine-ltd/ticket-picker

ActiveLibrary

appengine-ltd/ticket-picker
===========================

Ticket Picker Package

v1.7(1y ago)024proprietaryPHPPHP &gt;=8.2 &lt;8.5CI passing

Since Mar 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/appengine-ltd/ticket-picker)[ Packagist](https://packagist.org/packages/appengine-ltd/ticket-picker)[ RSS](/packages/appengine-ltd-ticket-picker/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (5)Versions (9)Used By (0)

TicketPicker for DrawEngine
===========================

[](#ticketpicker-for-drawengine)

[![Quality Gate Status](https://camo.githubusercontent.com/bf6430391e29886a0273cc7650c9fab370cbb81f0bda50d2c31fe8e1dbe32a9e/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d617070656e67696e652d6c74645f7469636b65742d7069636b6572266d65747269633d616c6572745f737461747573)](https://sonarcloud.io/summary/new_code?id=appengine-ltd_ticket-picker)[![Coverage](https://camo.githubusercontent.com/d3dd82b6a5f9f8c6b604dbc2fbcf822496e67c2969b4c1b9460fcc4a9b0e3c17/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d617070656e67696e652d6c74645f7469636b65742d7069636b6572266d65747269633d636f766572616765)](https://sonarcloud.io/summary/new_code?id=appengine-ltd_ticket-picker)[![Maintainability Rating](https://camo.githubusercontent.com/7bbd156e52002cac473777abdfa671e5bcf69a7ecb51af9c9f2ab3d94a5cc0da/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d617070656e67696e652d6c74645f7469636b65742d7069636b6572266d65747269633d7371616c655f726174696e67)](https://sonarcloud.io/summary/new_code?id=appengine-ltd_ticket-picker)[![Reliability Rating](https://camo.githubusercontent.com/02ed32efa5441de21ca9ffb404c3571bc32ebfe337b9710d38b9d4c0d04fd3e2/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d617070656e67696e652d6c74645f7469636b65742d7069636b6572266d65747269633d72656c696162696c6974795f726174696e67)](https://sonarcloud.io/summary/new_code?id=appengine-ltd_ticket-picker)[![Security Rating](https://camo.githubusercontent.com/b684dbd8cf3da52bf8de3d3d543686e10af1585b9fc73c96bba13cf2f761e2b4/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d617070656e67696e652d6c74645f7469636b65742d7069636b6572266d65747269633d73656375726974795f726174696e67)](https://sonarcloud.io/summary/new_code?id=appengine-ltd_ticket-picker)[![Bugs](https://camo.githubusercontent.com/f3c98c7a035dc2b129e7e58c2e0a1177219995143df96085d0e70dbd317aacea/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d617070656e67696e652d6c74645f7469636b65742d7069636b6572266d65747269633d62756773)](https://sonarcloud.io/summary/new_code?id=appengine-ltd_ticket-picker)[![Vulnerabilities](https://camo.githubusercontent.com/edb0f4e80b1cf125908c2b4c7f435aae865da2028df132daf60ab9adbc06ebbd/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d617070656e67696e652d6c74645f7469636b65742d7069636b6572266d65747269633d76756c6e65726162696c6974696573)](https://sonarcloud.io/summary/new_code?id=appengine-ltd_ticket-picker)[![Duplicated Lines (%)](https://camo.githubusercontent.com/f976efe559775be2fd3f079b7cb3a0f9f660949237eaa07c1d6686fbbf14a6d4/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d617070656e67696e652d6c74645f7469636b65742d7069636b6572266d65747269633d6475706c6963617465645f6c696e65735f64656e73697479)](https://sonarcloud.io/summary/new_code?id=appengine-ltd_ticket-picker)[![Lines of Code](https://camo.githubusercontent.com/db80e8c8c61c504561c51264ea995e4b97f0deeb1587fc0bc7ef4881c7dc4712/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d617070656e67696e652d6c74645f7469636b65742d7069636b6572266d65747269633d6e636c6f63)](https://sonarcloud.io/summary/new_code?id=appengine-ltd_ticket-picker)[![Technical Debt](https://camo.githubusercontent.com/d7d3c6d3a7f8ce77c0bc4499b1556f8f505f14be9859f0136290b20690657f5e/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d617070656e67696e652d6c74645f7469636b65742d7069636b6572266d65747269633d7371616c655f696e646578)](https://sonarcloud.io/summary/new_code?id=appengine-ltd_ticket-picker)[![Code Smells](https://camo.githubusercontent.com/fe21de4c6f32d568b6476b46f552b4a49010219d1bd2d4efb138e2ca29939edb/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d617070656e67696e652d6c74645f7469636b65742d7069636b6572266d65747269633d636f64655f736d656c6c73)](https://sonarcloud.io/summary/new_code?id=appengine-ltd_ticket-picker)

TicketPicker is an open source PHP library used to pick winning ticket codes for the DrawEngine system. It ensures fairness and transparency through deterministic code generation using a cryptographically secure seed, along with robust input validation and sanitization. Every step of the process is fully auditable, allowing anyone to verify that the draw was conducted fairly.

Features
--------

[](#features)

- **Deterministic Code Generation:** Generates a winning code from a set of ticket codes and a seed string, ensuring reproducibility.
- **Cryptographically Secure Seed Generation:** Uses secure methods to generate random seed strings.
- **Input Sanitization and Validation:** Automatically removes whitespace and checks that all ticket codes are consistent.
- **Transparency &amp; Auditability:** Fully open source, so the process can be independently verified.
- **Extensible:** Provides clear interfaces for future extensions.

Requirements
------------

[](#requirements)

- PHP 8.2 to PHP 8.4 (tested up to PHP 8.4; if using higher versions, you may need to bypass certain environment checks)
- Composer

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require appengine/ticketpicker
```

Or clone the repository directly:

```
git clone https://github.com/yourusername/ticketpicker.git
cd ticketpicker
composer install
```

Usage
-----

[](#usage)

### Generating a Winning Code

[](#generating-a-winning-code)

The main functionality is provided by the `Picker` class. Given an array of ticket codes and a seed string, the `Picker` will generate an 8-character winning code by selecting one character from each position of the sanitized ticket codes.

```
