All requests | > | PHP API Key Generator | > | Request new recommendation | > | Featured requests | > | No recommendations |
by mzer terungwa - 1 month ago (2017-02-11)
0 | I have created a restful API for a hosted service. To restrict indiscriminate access to the API, each client must submit an API key to be authenticated. I need a nice PHP class for this if any. |
-1 | by tony jabbour 40 - 20 hours ago (2017-03-23) Comment i am using this currently to generate a unique license try to edit it to your needs function UniqueLicense(){ $Block1 = substr(uniqid(), 8, 5); $TimeArray = explode('.', microtime()); $TimeArray2 = explode(' ', $TimeArray[1]); $TimeArray3 = sha1(base_convert($TimeArray2[0] . $TimeArray2[1], 10, 16)); $Block2 = substr($TimeArray3, 5, 5); $Sub1 = sha1(substr($TimeArray3, 10, 5)); $Sub2 = substr($Sub1,rand(0, strlen($Sub1) - 5),rand(0, strlen($Sub1) - 5) + 5); $Block3 = substr($Sub2, 0, 5); $Block4 = substr(rand(),0,5); //$BlockLicense1 .= $Block1 . '-' . $Block2 . '-' . $Block3 . '-' . $Block4 ; $char = "0213456789abcdefghijklmnopqrstuvwxyz"; $Block5 =substr(str_shuffle(str_repeat($char, 5)), 0,2); $Block6 = substr(str_shuffle(str_repeat($char, 5)), 0,2); $Sub3 = substr(str_shuffle(str_repeat($char, 5)), 0,5); $sub4 = substr(MD5($Sub3), 10, 5); //$BlockLicense2 .= $Block5 . '-' . $Block6 . '-' . $Block7 . '-' . $Block8 ; $Block9 = str_replace(substr($Block4, 3, 2), $Block5, $Block4); $Block10 = str_replace(substr($Block2, 3, 2), $Block6, $Block2); $subs = array($Sub3,$sub4,$Block1,$Block3); $rand = array_rand($subs,2); $Block11 = $subs[$rand[0]]; $Block12 = $subs[$rand[1]];
$BlockLicense .= $Block9 . '-' . $Block10 . '-' . $Block11 . '-' . $Block12 ; return strtoupper($BlockLicense); } |
1. by Manuel Lemos Reply
- 20 hours ago (2017-03-23)You are not recommending a package class.
Recommend package | |
|