To create a SHA1 hash from a string in PHP, you can use the sha1()
function. This function returns a 40-character string that represents the SHA1 hash of the input string.
Here is an example code snippet:
main.php149 chars6 lines
Output:
main.php80 chars3 lines
In this example, the input string is "Hello, world!" and the resulting SHA1 hash is "f7ff9e8b7bb2e09b70935a5d785e0cc5d9d0abf0".
gistlibby LogSnag