mirror of
https://github.com/vgough/encfs.git
synced 2025-03-13 05:48:12 +01:00
15 lines
408 B
PHP
15 lines
408 B
PHP
# Helper function
|
|
# Get the MD5 sum of the file open at the filehandle
|
|
sub md5fh
|
|
{
|
|
my $fh_orig = shift;
|
|
open(my $fh, "<&", $fh_orig); # Duplicate the file handle so the seek
|
|
seek($fh, 0, 0); # does not affect the caller
|
|
my $md5 = Digest::MD5->new->addfile($fh)->hexdigest;
|
|
close($fh);
|
|
return $md5;
|
|
}
|
|
|
|
# As this file will be require()'d, it needs to return true
|
|
return 1;
|