PHP API Key Generator

前端 未结 9 588
天命终不由人
天命终不由人 2020-12-04 09:21

Does anyone know of any API key generator script/class for PHP? The class should have method generate, that would generate a key and isValid() method, to check if the key is

9条回答
  •  春和景丽
    2020-12-04 09:39

    GUID would work but is not cryptographically secure.

    Server answers use md5 or sha1 hashing methods on microtime() or mt_rand.

    Hashing a uniqid, uuid or timestamp would not necessarily create unique results! Actually hashing increases the chance of collisions so I would strongly advise against this.

提交回复
热议问题