storyous / bucket-determinator
Installs: 42 701
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 16
Forks: 0
Open Issues: 0
Requires (Dev)
- nette/tester: ^2.0
This package is auto-updated.
Last update: 2024-10-29 05:46:43 UTC
README
BucketDeterminator
This is small helper library to determine bucket allegiance based on MongoDB/ObjectId.
Usage
use BucketDeterminator\BucketDeterminator; $bucketDeterminator = new BucketDeterminator(32); echo $bucketDeterminator->determine('5576a1a886157828c11bac4f'); // 15
const bucketDeterminator = require('../src/BucketDeterminator'); const determinator = bucketDeterminator(); return determinator.determine('5576a1a886157828c11bac4f'); //15
Run tests
php vendor/bin/tester --coverage ./coverage.html --coverage-src ./src -c /path/to/php-ini/php.ini tests
npm run test
License
MIT License
Copyright (c) 2018 storyous.com s.r.o.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.