3 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/perl -w
#
# $Id: shorthash,v 1.2 2003/08/01 02:10:57 jmates Exp $
#
# The author disclaims all copyrights and releases this script into the
# public domain.
#
# Generates short (eight character) hashes from MD5 hex signatures.
require 5;
use strict;
use Digest::MD5;
my $fh;
if (@ARGV) {
my $file = shift;
open $fh, $file or die "error: could not open $file: $!\n";
binmode $fh;
} else {
$fh = *STDIN;
}
printf "%08x\n", unpack "N", Digest::MD5->new->addfile($fh)->digest;
QuoteAn unsigned long in "network" (big-endian) order.
print Digest::MD5->new->addfile($fh)->hexdigest;
3 Einträge, 1 Seite |