diff options
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r-- | usr.sbin/pkg_add/pod/OpenBSD::md5.pod | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/usr.sbin/pkg_add/pod/OpenBSD::md5.pod b/usr.sbin/pkg_add/pod/OpenBSD::md5.pod index 409f2efa33f..1faf2fa179a 100644 --- a/usr.sbin/pkg_add/pod/OpenBSD::md5.pod +++ b/usr.sbin/pkg_add/pod/OpenBSD::md5.pod @@ -1,29 +1,24 @@ -$OpenBSD: OpenBSD::md5.pod,v 1.1 2012/01/15 14:16:16 espie Exp $ +$OpenBSD: OpenBSD::md5.pod,v 1.2 2019/05/26 15:55:11 espie Exp $ =head1 NAME -OpenBSD::md5 - simple interface to md5 and sha256 digests +OpenBSD::md5 - simple interface to sha256 digests =head1 SYNOPSIS use OpenBSD::md5; - my $md5 = OpenBSD::md5->new($filename); - $k->{$md5->key} = $filename; + my $sha = OpenBSD::sha->new($filename); + $k->{$sha->key} = $filename; - my $ck2 = $md5->new($filename2); + my $ck2 = $sha->new($filename2); - if ($ck2->equals(md5)) { + if ($ck2->equals($sha)) { ... } - print $md5->stringize # provides an hex representation - - my $ck3 = OpenBSD::sha->new($filename); - !$ck3->equals($ck2); # comparing is okay, but will never match - my $s = $ck3->stringize; # base64 representation - - my $ck4 = $s->fromstring; # decodes both base64 and hex + print $sha->stringize # provides a base64 representation + my $ck3 = $s->fromstring; # decodes both base64 and hex @@ -36,12 +31,11 @@ In particular, it provides an abstraction to build crypto hashes from files, convert from and to text, and compare two checksums while keeping the user from making low-level decisions. -There are two classes, C<OpenBSD::md5> and C<OpenBSD::sha> which provide the -same facilities, respectively for md5 and sha256 digests. +The module itself is called C<OpenBSD::md5> for historical reasons, +but the module only provides a C<OpenBSD::sha> class, that produces +and writes sha256 digests. -The module itself is called C<OpenBSD::md5> for historical reasons. -Support for md5 digests is there for legacy reasons, all new code should -produce and write sha256 digests only. +The C<OpenBSD::md5> class itself was removed a few years ago. =over 8 @@ -56,14 +50,10 @@ create a new digest object from a string representation. =item $o2 = $o-E<gt>new($filename) / $o-E<gt>fromstring($string) create a new digest object C<$o2> of the same type as C<$o>. -This can be used to compare a file against an existing digest, which may -well be of md5 type in very old packages. Even though the use of md5 -is deprecated, checking md5 checksums is still slightly better than nothing... =item $o-E<gt>equal($o2) -compare two digest objects. Returns true only if they're of the same type -and they match. +compare two digest objects. Returns true only if they match. =item $h{$o-E<gt>key} = ... @@ -83,6 +73,5 @@ writes an appropriate digest annotation on a packing-list filehandle =head1 SEE ALSO L<cksum(1)> , -L<Digest::MD5(3p)> , L<Digest::SHA(3p)> , L<Mime::Base64(3p)> |