Вопрос

What are the possible characters for $code:

$randStr = "some random string that contains only: [a-zA-Z0-9_]";
$code = hash('sha512', $randStr);
Это было полезно?

Решение

SHA512 will generate 128 characters of lowercase HEX characters (0 to f), e.g.

a9046c73e00331af68917d3804f70655a9046c73e00331af68917d3804f70655a9046c73e00331af68917d3804f70655

See the documentation for hash() for more information.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top