https://github.com/r-lyeh-archived/cocoa
:chocolate_bar: Cocoa is an uniform hashing library with no dependencies that provides interface for CRC32, CRC64, GCRC, RS, JS, PJW, ELF, BKDR, SBDM, DJB, DJB2, BP, FNV, FNV1a, AP, BJ1, MH2, SHA1, SFH (C++11)
https://github.com/r-lyeh-archived/cocoa
Last synced: 25 days ago
JSON representation
:chocolate_bar: Cocoa is an uniform hashing library with no dependencies that provides interface for CRC32, CRC64, GCRC, RS, JS, PJW, ELF, BKDR, SBDM, DJB, DJB2, BP, FNV, FNV1a, AP, BJ1, MH2, SHA1, SFH (C++11)
- Host: GitHub
- URL: https://github.com/r-lyeh-archived/cocoa
- Owner: r-lyeh-archived
- License: zlib
- Created: 2013-04-12T13:55:32.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2015-06-12T17:13:54.000Z (almost 10 years ago)
- Last Synced: 2025-04-29T20:59:29.230Z (25 days ago)
- Language: C++
- Homepage:
- Size: 192 KB
- Stars: 24
- Watchers: 4
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- AwesomeCppGameDev - cocoa
README
- Cocoa is an uniform hashing library written in C++11.
- Cocoa provides interface for CRC32, CRC64, GCRC, RS, JS, PJW, ELF, BKDR, SBDM, DJB, DJB2, BP, FNV, FNV1a, AP, BJ1, MH2, SHA1, SFH.
- Cocoa is tiny. Header-only.
- Cocoa is cross-platform. No dependencies.
- Cocoa is zlib/libpng licensed.### Sample
```c++
#include
#include
#include "cocoa.hpp"int main() {
std::string hash = cocoa::SHA1("hello world");
std::cout << hash << std::endl;
assert( cocoa::SHA1("hello world") == cocoa::SHA1("hello world") );
return 0;
}
```### Possible output
---------------
~/cocoa>./test
2aae6c35c94fcfb415dbe95f408b9ce91ee846ed
~/cocoa>### C++03
Check old [c++03 version here](https://github.com/r-lyeh/cocoa/tree/c70a878eae074f73ae7f5222503538c130fd6a0d)### API
For more details check the [tests.cxx](tests.cxx) file.### Cocoa::hash() API
- @todocument### Changelog
- v1.0.0 (2015/06/12)
- Removed warning
- v0.0.0 (2010/xx/xx)
- Initial commit