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)
Install / Use
/learn @r-lyeh-archived/CocoaREADME
cocoa <a href="https://travis-ci.org/r-lyeh/cocoa"><img src="https://api.travis-ci.org/r-lyeh/cocoa.svg?branch=master" align="right" /></a>
- 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
#include <cassert>
#include <string>
#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
<pre> ~/cocoa>./test 2aae6c35c94fcfb415dbe95f408b9ce91ee846ed ~/cocoa> </pre>
C++03
Check old c++03 version here
API
For more details check the tests.cxx file.
Cocoa::hash() API
- @todocument
Changelog
- v1.0.0 (2015/06/12)
- Removed warning
- v0.0.0 (2010/xx/xx)
- Initial commit
Related Skills
node-connect
347.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
