Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joyeecheung/md5
An md5 implementation in C++.
https://github.com/joyeecheung/md5
Last synced: 26 days ago
JSON representation
An md5 implementation in C++.
- Host: GitHub
- URL: https://github.com/joyeecheung/md5
- Owner: joyeecheung
- Created: 2014-10-16T21:13:33.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-24T06:55:39.000Z (about 10 years ago)
- Last Synced: 2024-08-01T19:52:49.595Z (3 months ago)
- Language: C++
- Homepage:
- Size: 125 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
###Dependencies
1. Linux
2. g++ and GNU make###How to Run Tests
1. Edit the Makefile, make sure `CFLAGS=-c -g -Wall -DSAMPLE_TEST`
2. If you have built the program before, run `make clean`
3. In the project directory, run `make`
4. In the project directory, run `./md5`###How to Use It As a Program
1. Edit the Makefile, make sure `CFLAGS=-c -g -Wall`
2. If you have built the program before, run `make clean`
3. In the project directory, run `make`
4. In the project directory, run `./md5`
5. Enter strings into stdin, the results will be output to stdoutIf you want to use redirection, this is an example. (Checkout the `test` target in Makefile)
```bash
./md5 < testcase/in > testcase/result
```###API
* `string md5(const string str)`
Sample usage:
```cpp
#include
#include "md5.h"
using namespace joyee;int main(int argc, char* argv[]) {
std::cout << md5("abc") << '\n'; // 900150983cd24fb0d6963f7d28e17f72
return 0;
}
```
* `update`, `finalize`, `toString`Sample usage:
```cpp
#include
#include
#include "md5.h"
using namespace joyee;int main(int argc, char* argv[]) {
MD5 md5 = MD5();
int data = 1234;
md5.update(reinterpret_cast(&data), sizeof(data));
md5.finalize();
std::cout << md5.toString() << '\n'; // 099c28f29510c7938bc8c307d287557f
return 0;
}
```###About
* [Github repository](https://github.com/joyeecheung/md5)
* Author: Qiuyi Zhang
* Time: Oct. 2014