Exemple #1
0
<?php

include_once 'vendor/autoload.php';
echo "The 10001th prime is: " . gmp_strval(Math\Calculator::generateNthPrime(10000)) . "\n";
echo "The sum of 50th first fibonacci numbers is: " . gmp_strval(Math\Calculator::sumOfFibonacciElements(49)) . "\n";
$cipher = new Crypto\Cipher(new Crypto\Relation(range('a', 'z'), range(1, 26)));
echo "The e-mail is: " . $cipher->encrypt('*****@*****.**', 11) . "\n";
 /**
  * @dataProvider invalidWords
  *
  * @expectedException InvalidArgumentException
  * @expectedExceptionMessage Crypto\Cipher::INVALID_WORD
  */
 public function testEncryptWithEmptyWordShouldThrowException($invalidWord)
 {
     Crypto\Cipher::encrypt($invalidWord, 1);
 }