Boost logo

Boost :

Subject: [boost] Any interest in hashing algorithms SHA and/or FNV1a?
From: foster brereton (fosterb+boost_at_[hidden])
Date: 2013-11-12 13:52:45

I have been working on implementations of the SHA and FNV-1a class of
hashing algorithms. Both are header-only.

SHA (Secure Hash Algorithms)
Implementations for SHA-1, -224, -256, -384, and -512. It does not
implement the more recent SHA-3 (Keccak) algorithm. It would not be
difficult to add support for 512/224 and 512/256 if they were desired.
The routines support bit-level messages, meaning they can correctly
digest messages that do not end on a byte boundary. More information

FNV (Fowler–Noll–Vo)
The header supports the FNV-1a algorithm, which has better
distribution characteristics than its cousin, FNV-1. I have added
support for 32-, 64-, 128-, 256-, and 1024-bit variants. This is not a
cryptographically secure algorithm, however is much faster than its
crypto cousins and as such is a solid algorithm for obtaining unique
hash values for e.g., data structures. I have also implemented a
constexpr variant of the algorithm (32-bit and 64-bit only) for const
char* to further performance when needed by pushing the hash to
compile-time computation.
More information here:

The algorithms are currently part of the Adobe Source Libraries on GitHub:

(note: the master branch version needs updating to this one.)


Would these algorithms be of general use to the Boost community? If so
I would be willing to submit them formally.

Boost list run by bdawes at, gregod at, cpdaniel at, john at