create a sha3_512 hash from a string in php

To create a SHA3-512 hash from a string in PHP, you can use the hash function with the "sha3-512" algorithm. Here is an example:

main.php
$string = "example";
$hash = hash("sha3-512", $string);
echo $hash;
68 chars
4 lines

This will output:

main.php
33b1d25a888a9b7ebe4914908c4ff90f03b821d16e6f88b8e3d3ecb374a2841747a0f83c14003198cf625da9a9b0da4ee4a4d03a30c4ad451004f0aafbc4925
128 chars
2 lines

This hash can be used for secure storage or comparison with other hashes. It is important to use secure hashing functions like SHA3-512 to protect sensitive data.

gistlibby LogSnag