PHP string sha1() FunctionPHP string sha1() is predefined function.It is used to calculate the SHA-1 hash of a string. It uses US secure Hash Algorithm 1. SHA-1 produces a 160-bit output called a message digest. Note: To calculate the SHA-1 hash of a file, use the sha1_file()function.Syntax:
Warning: It not recommended to use sha1 function to secure passwords, due to the fast nature of this hashing algorithm. Example 1Output: Your string isHello PHP a02e266c6f3a8ff0c4250e502828c4ebf179d252 Example 2Output: The string: Hello PHP TRUE - Raw 20 character binary format: ?.&lo:???%P((???y?R FALSE - 40 character hex number: a02e266c6f3a8ff0c4250e502828c4ebf179d252 Next TopicPHP String |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India