Beginner Friendly · Hands-on · Free

Calculate the SHA-1 hash of a file

sha1_file() function ஒரு string இன் SHA-1 file hash value ஐ calculate செய்வதற்கு பயன்படுகிறது. இந்த function US secure Hash Algorithm 1 ஐ பயன்படுத்துகிறது. SHA-1 security மற்றும் hashing function ஆக பயன்படுகிறது.

5 min read Updated Dec 02, 2025

sha1_file() Function in PHP

sha1_file() function ஒரு string இன் SHA-1 file hash value ஐ calculate செய்வதற்கு பயன்படுகிறது. இந்த function US secure Hash Algorithm 1 ஐ பயன்படுத்துகிறது. SHA-1 security மற்றும் hashing function ஆக பயன்படுகிறது.

sha1_file(file, raw)

Note: இங்கு file மற்றும் raw(TRUE அல்லது FALSE ) ஆனது argument ஆக அனுபப்படுகிறது. TRUE என இருக்கும் போது Raw 20 character binary format SHA-1 file hash value ஐ தருகிறது, அதேபோல் FALSE என இருக்கும் போது Default. 40 character hex number format SHA-1 file hash value ஐ தருகிறது.

Example1

<?php
$filename = "test.txt";  
echo sha1_file($filename);   
?>

மேலே உள்ள Example1-ஐ கவனிக்கவும் $filename என்ற variable இல் "test.txt" என்ற file name ஆனது உள்ளது. sha1_file() function இல் arugument ஆக அனுப்பும் போது a02e266c6f3a8ff0c4250e502828c4ebf179d252 என்ற 40 character hex number format SHA-1 file hash value ஐ தருகிறது.

Output:

a02e266c6f3a8ff0c4250e502828c4ebf179d252

Example2

<?php
$file = 'testvf.txt';
echo sha1_file($file); 
?>

மேலே உள்ள Example2-ஐ கவனிக்கவும் $file என்ற variable இல் 'testvf.txt' என்ற file name ஆனது உள்ளது. sha1_file() function இல் arugument ஆக அனுப்பும் போது 833cd96367d51bb065f486f4b2bd7fe8bcb70996 என்ற 40 character hex number format SHA-1 file hash value ஐ தருகிறது.

Output:

833cd96367d51bb065f486f4b2bd7fe8bcb70996

இது பற்றிய தங்களின் கருத்துகளை இங்கே பதிவிடுங்கள் . இது பயனுள்ளதாக விரும்பினால் மற்றவர்களுக்கும் இதை share செய்யுங்கள்.