PHP生成ASE随机密钥

function keygen($length) {
   $token = '';
   $tokenlength = round($length * 4 / 3);
   for ($i = 0; $i < $tokenlength; ++$i) {
       $token .= chr(rand(32, 1024));
   }
   $token = base64_encode(str_shuffle($token));
   return substr($token, 0, $length);
}

From: https://github.com/gladchinda/keygen-php/blob/master/src/Keygen/Generators/TokenGenerator.php
转载原文:https://www.imaegoo.com/2020/aes-key-generator/

Jsky博客
请先登录后发表评论
  • 最新评论
  • 总共0条评论