There are a few trusted, simple versions available -- I have a few in the sources of the digest for R.
Here is what I wrote in the DESCRIPTION file:
Description: The digest package
provides functions for the creation
of `hash' digests of arbitrary R
objects using the md5, sha-1, sha-256
and crc32 algorithms permitting easy
comparison of R language objects. The
md5 algorithm by Ron Rivest is
specified in RFC 1321, the SHA-1 and
SHA-256 algorithms are specified in
FIPS-180-1 and FIPS-180-2, and the
crc32 algorithm is described in
ftp://ftp.rocksoft.com/cliens/rocksoft/papers/crc_v3.txt.
For md5, sha-1 and sha-256, this
packages uses small standalone
implementations that were provided by
Christophe Devine. For crc32, code
from the zlib library is used.
I think some of Christophe's code is no longer at cr0.net, but searches should lead you to several other projects incorporating it. His file headers were pretty clear:
/*
* FIPS-180-1 compliant SHA-1 implementation,
* by Christophe Devine <[email protected]>;
* this program is licensed under the GPL.
*/
and his code matches the reference output.