sha1 used to calculate the SHA-1 hash of a string
sha1() function ஒரு string இன் SHA-1 hash value ஐ calculate செய்வதற்கு பயன்படுகிறது. இந்த function US secure Hash Algorithm ஐ பயன்படுத்துகிறது. SHA-1 security மற்றும் hashing function ஆக பயன்படுகிறது
sha1() Function in PHP
sha1() function ஒரு string இன் SHA-1 hash value ஐ calculate செய்வதற்கு பயன்படுகிறது. இந்த function US secure Hash Algorithm ஐ பயன்படுத்துகிறது. SHA-1 security மற்றும் hashing function ஆக பயன்படுகிறது.
sha1(string, raw)
Example1
<?php
$input = "php string functions";
echo sha1($input);
?>
மேலே உள்ள Example1-ஐ கவனிக்கவும் $input என்ற variable இல் "php string functions" என்ற string ஆனது உள்ளது. sha1 function இல் arugument ஆக அனுப்பும் போது e877af7f6b86cc9d48601b9cc6ce7fb9ff162bbb என்ற 40 character hex number format SHA-1 hash value ஐ தருகிறது.
e877af7f6b86cc9d48601b9cc6ce7fb9ff162bbb
Example2
<?php
$data = "learn php tamil";
echo sha1($data,true);
?>
மேலே உள்ள Example2-ஐ கவனிக்கவும் $data என்ற variable இல் "learn php tamil" என்ற string ஆனது உள்ளது.sha1 function இல் arugument ஆக அனுப்பும் போது .�=��3�l�G� ��Q��� என்ற 20 character binary format SHA-1 hash value ஐ தருகிறது. ஏனென்றால் இங்கு இரண்டாவது argument true என உள்ளது.
.�=��3�l�G� ��Q���