Answer the question
In order to leave comments, you need to log in
What is the correct and easiest way to generate a key?
I do the key generation for checks in the following way:
// Генерируем ключ
$symbol=array('0','1','2','3','4','5','6','7','8','9','A','a','B','b','C','c','D','d','E','e','F','f','G','g','H','h','I','i','J','j','K','k','L','l','M','m','N','n','O','o','P','p','Q','q','R','r','S','s','T','t','U','u','V','v','W','w','X','x','Y','y','Z','z');
for ($i=0; $i<20; $i++):
$rand_symbol=$symbol[rand(0,61)];
$key=$key.$rand_symbol;
endfor;
echo $key;
Answer the question
In order to leave comments, you need to log in
Read about cryptographic functions php.net/manual/ru/refs.crypto.php
The way you generate a token is not very secure
For example take a look at open ssl
php.net/manual/ru/function.openssl-encrypt.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question