Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the possible output characters of sha512?

Tags:

php

hash

sha512

What are the possible characters for $code:

$randStr = "some random string that contains only: [a-zA-Z0-9_]";
$code = hash('sha512', $randStr);
like image 687
Mohsin Avatar asked Dec 30 '25 23:12

Mohsin


1 Answers

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

a9046c73e00331af68917d3804f70655a9046c73e00331af68917d3804f70655a9046c73e00331af68917d3804f70655

See the documentation for hash() for more information.

like image 176
Raptor Avatar answered Jan 01 '26 11:01

Raptor