Skip to content

Commit

Permalink
Documentation fix and build file update.
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Carl committed Mar 10, 2017
1 parent 32ce5f8 commit 79a6c2a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ script:

after_script:
# We upload only for reference platform! This is our base for further code analyses and so on.
- if [ $(phpenv version-name) == "5.6" ] && [ "$PREFER_LOWEST" == "--prefer-lowest" ]; then bin/codacycoverage clover build/logs/clover.xml -vvv; fi
- if [ $(phpenv version-name) == "5.6" ] && [ "$PREFER_LOWEST" == "--prefer-lowest" ]; then bin/codacycoverage clover build/logs/clover.xml; fi

after_success:
# Push coverage to github pages branch
Expand Down
43 changes: 20 additions & 23 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
Copyright (c) 2015, clickalicious GmbH, Benjamin Carl
All rights reserved.
rng

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
(The MIT license)
Copyright 2017 clickalicious UG, Benjamin Carl

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
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:

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

* Neither the name of Rng nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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.
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,29 @@ The secure **Pseudo Random Number Generator** `PRNG` for PHP.

## Examples

Generate `random number` between 1 and 10 using `OpenSSL` random bytes (library default):
Generate `random number` between 1 and 10 using `OPEN_SSL` random bytes (library default):
```php
$generator = new Rng\Generator();
$number = $generator->generate(1, 10);
echo $number;
```

Generate `random number` between 1 and 10 using `MCrypt` random bytes:
Generate `random number` between 1 and 10 using `PHP_MERSENNE_TWISTER` random bytes:
```php
$generator = new Rng\Generator(Rng\Generator::MODE_MCRYPT);
$generator = new Rng\Generator(Rng\Generator::MODE_PHP_MERSENNE_TWISTER);
$number = $generator->generate(1, 10);
echo $number;
```

Generate `16 random bytes` using `OpenSSL` random bytes (library default):
Generate `16 random bytes` using `MODE_OPEN_SSL` random bytes (library default):
```php
$generator = new Rng\Generator();
$bytes = $generator->getRandomBytes(16);
```

Generate `32 random bytes` using `MCrypt` random bytes:
Generate `32 random bytes` using `NATIVE-PHP` random bytes:
```php
$generator = new Rng\Generator(Rng\Generator::MODE_MCRYPT);
$generator = new Rng\Generator();
$bytes = $generator->getRandomBytes(32);
```

Expand All @@ -79,7 +79,8 @@ You can create a visualization of randomization (as you can see below but larger
This library provides a state of the art `PRNG` (**P**seudo **R**andom **N**umber **G**enerator) implementation to generate secure `Pseudo Random Numbers` with PHP. The generation is either based on `Open SSL` or `MCrypt` or as fallback on PHP's internal functionality. The library also provides a very good `Seed generator` on puplic API. If you are interested in the difference between real and pseduo randomness then you could start at [https://www.random.org/randomness/](https://www.random.org/randomness/ "https://www.random.org/randomness/").

[![Scott Adams](https://www.random.org/analysis/dilbert.jpg)](http://dilbert.com/strip/2001-10-25 "Copyright Universal Uclick / Scott Adams")
DILBERT © 2001 Scott Adams.

`DILBERT © 2001 Scott Adams.`


## Versioning
Expand All @@ -89,11 +90,7 @@ For a consistent versioning i decided to make use of `Semantic Versioning 2.0.0`

## Roadmap

- [x] Target stable release `1.0.0`
- [x] `>= 90%` test coverage
- [x] Better visualization
- [x] Integrate polyfill
- [ ] Security check through 3rd-Party (Please get in contact with me)
- No open issues.

[![Throughput Graph](https://graphs.waffle.io/clickalicious/rng/throughput.svg)](https://waffle.io/clickalicious/rng/metrics)

Expand Down

0 comments on commit 79a6c2a

Please sign in to comment.