Recommend this page to a friend! |
All requests | > | PHP API Key Generator | > | Request new recommendation | > | Featured requests | > | No recommendations |
by mzer terungwa - 7 years ago (2017-02-11)
+6 | 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. |
0 | by John Conde 75 - 4 years ago (2020-06-17) Comment The GUID Generator class creates a globally unique identifier that is ideal for API keys. GUIDs, also known ad UUIDs (Universally Unique IDs) are used in enterprise applications to provide a virtually guaranteed unique identifier for your users, as database keys, component identifiers, or just about anywhere else a unique identifier is required. IDs are so unique that if everyone in the world generated 600,000,000 GUIDs there is a 50% chance that ONE key will be duplicated. |
0 | by DeGraciaMathieu 75 - 6 years ago (2018-02-06) Comment Hello, You can create random token with this package |
3. by Felicia Kelley - 6 years ago (2018-05-02) in reply to comment 2 by DeGraciaMathieu Reply
Great job
0 | by tony jabbour 50 - 7 years 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
- 7 years ago (2017-03-23)You are not recommending a package class.
Recommend package | |
|