Print one hash. It is the well-known SHA-1 of "abc".
Compare both. They are identical, so you can switch to hash() later.
Frequently Asked Questions
sha1() calculates the SHA-1 hash of a string and returns it as a 40-character hexadecimal string. The same input always gives the same output.
sha1(string $string, bool $binary = false): string. The first argument is the text to hash. The optional second argument returns raw binary when set to true.
No. SHA-1 is fast and has known collision weaknesses. Use password_hash() to store passwords and password_verify() to check them.
A hex result is always 40 characters. With the binary option set to true, you get 20 raw bytes.
Use sha1_file() with the file path. It reads the file for you and returns the same kind of 40-character hash.