public function __invoke()
 {
     $generator = new HashGenerator();
     $i = 1;
     while (true) {
         $hash = $generator->generateHash("ckczppom", $i, "md5");
         echo $i . ": " . $hash . "\n";
         if (substr($hash, 0, 5) !== "00000") {
             $i++;
             continue;
         }
         echo "Lowest integer required to produce a hash starting with five zeroes: " . $i;
         break;
     }
 }
Beispiel #2
0
 protected static function prepareAuthorizationString(Request $request, Options $options, $rnd)
 {
     $hash = HashGenerator::generateHash($options->getApiKey(), $options->getSecretKey(), $rnd, $request);
     return vsprintf("IYZWS %s:%s", array($options->getApiKey(), $hash));
 }