$myString = "Hello World"; $hashValue = hash('sha256', $myString); echo $hashValue;
$salt = "random-str"; $myString = "Hello World"; $hashValue = hash('sha256', $myString . $salt); echo $hashValue;
$key = "secret_key"; $data = "Hello World"; $hashValue = hash_hmac('sha256', $data, $key); echo $hashValue;The hash function is included in the standard PHP library, and no additional package or library is required to use this function.