$OpenBSD: OpenBSD::md5.pod,v 1.2 2019/05/26 15:55:11 espie Exp $ =head1 NAME OpenBSD::md5 - simple interface to sha256 digests =head1 SYNOPSIS use OpenBSD::md5; my $sha = OpenBSD::sha->new($filename); $k->{$sha->key} = $filename; my $ck2 = $sha->new($filename2); if ($ck2->equals($sha)) { ... } print $sha->stringize # provides a base64 representation my $ck3 = $s->fromstring; # decodes both base64 and hex =head1 DESCRIPTION C provides an object-oriented interface to cryptographic hashing facilities for use in the ports tree. 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. The module itself is called C for historical reasons, but the module only provides a C class, that produces and writes sha256 digests. The C class itself was removed a few years ago. =over 8 =item $o = $class-Enew($filename) create a new digest object from the contents of a file. =item $o = $class-Efromstring($string) create a new digest object from a string representation. =item $o2 = $o-Enew($filename) / $o-Efromstring($string) create a new digest object C<$o2> of the same type as C<$o>. =item $o-Eequal($o2) compare two digest objects. Returns true only if they match. =item $h{$o-Ekey} = ... return the actual digest as a binary string, for use as a key in hashing. =item $s = $o-Estringize convert the digest into a suitable text representation. =item $o-Ewrite($fh) writes an appropriate digest annotation on a packing-list filehandle (see L and L). =back =head1 SEE ALSO L , L , L