Mohsin
Mohsin

Reputation: 533

What are the possible output characters of sha512?

What are the possible characters for $code:

$randStr = "some random string that contains only: [a-zA-Z0-9_]";
$code = hash('sha512', $randStr);

Upvotes: 3

Views: 4852

Answers (2)

Raj Kumar
Raj Kumar

Reputation: 61

SHA_512 will generate 130 characters

0xFFF50A71FE36FA45829B4E7F2426D25758635235335C39C11089B27805312BD73C83ACD3B71EAF47267368AEEDA289A4A2F7A191BABA1A3CAB9A2543CC06BC65

Upvotes: 0

Raptor
Raptor

Reputation: 54258

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

a9046c73e00331af68917d3804f70655a9046c73e00331af68917d3804f70655a9046c73e00331af68917d3804f70655

See the documentation for hash() for more information.

Upvotes: 9

Related Questions