- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What do we mean by hash functions in PHP?
A hash function is any function that can be used to map data of arbitrary size to data of a fixed size. The values returned by a hash function are called hash values, hash codes, digests, or simply hashes.
Syntax
string hash( string $algo , string $data [, bool $raw_output = FALSE ] )
Parameters
algo
Name of selected hashing algorithm (like "md5", "sha256", "haval160,4", etc..)
data
Message to be hashed.
raw_output
When setting to TRUE, outputs raw binary data. FALSE outputs lowercase hexits.
Example
<?php echo hash('sha256', 'Weelcome Tutorials Point'); ?>
Output
dacbedc476c664e457b165580dd5eb491bc027c914504066c51f56b1116d56e0
Advertisements