php 和 perl 针对文件 的md5

php

<?php
$file = '1.txt';

echo 'MD5 file hash of ' . $file . ': ' . md5_file($file);
?>


perl

#!/usr/bin/perl -w
use strict;
use Digest::MD5;
my $file_check="1.txt";
open( FH, $file_check ) or die "Can't open '$file_check': $!";
binmode(FH); 
print Digest::MD5->new->addfile(*FH)->hexdigest, " $file_check\n";


你可能感兴趣的:(php 和 perl 针对文件 的md5)