Skip to content

Commit 4d7bf5b

Browse files
committed
Updated README.md
1 parent f784b71 commit 4d7bf5b

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,41 @@
22

33
[![Build Status](https://api.travis-ci.org/wsjcpp/wsjcpp-hashes.svg?branch=master)](https://travis-ci.org/wsjcpp/wsjcpp-hashes) [![Github Stars](https://img.shields.io/github/stars/wsjcpp/wsjcpp-hashes.svg?label=github%20%E2%98%85)](https://github.com/wsjcpp/wsjcpp-hashes/stargazers) [![Github Stars](https://img.shields.io/github/contributors/wsjcpp/wsjcpp-hashes.svg)](https://github.com/wsjcpp/wsjcpp-hashes/) [![Github Forks](https://img.shields.io/github/forks/wsjcpp/wsjcpp-hashes.svg?label=github%20forks)](https://github.com/wsjcpp/wsjcpp-hashes/network/members)
44

5+
6+
## Intagrate to your project
7+
8+
```
9+
$ wsjcpp install https://github.com/wsjcpp/wsjcpp-hashes:master
10+
```
11+
12+
or include this files:
13+
14+
* src.wsjcpp/wsjcpp_core/wsjcpp_core.h
15+
* src.wsjcpp/wsjcpp_core/wsjcpp_core.cpp
16+
* src/md5.cpp
17+
* src/md5.h
18+
* src/smallsha1.cpp
19+
* src/smallsha1.h
20+
* src/wsjcpp_hashes.h
21+
* src/wsjcpp_hashes.cpp
22+
23+
24+
## Usage
25+
26+
```
27+
#include <wsjcpp_hashes.h>
28+
29+
void main() {
30+
std::string sSource = "some123";
31+
std::string sSha1 = WSJCppHashes::sha1_calc_hex(sSource);
32+
std::string sMd5 = WSJCppHashes::md5_calc_hex(sSource);
33+
std::cout << "sha1('" << sSource << "') = " << sSha1 << std::endl;
34+
std::cout << "md5('" << sSource << "') = " << sMd5 << std::endl;
35+
}
36+
```
37+
38+
example output:
39+
```
40+
sha1('some123') = 1225f79dee075a65ca92df080106ab40d15e5ba1
41+
md5('some123') = 302d62e9451df39a97f73dec7f9272ef
42+
```

src/main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ int main(int argc, char* argv[]) {
88
std::string appName = std::string(WSJCPP_NAME);
99
std::string appVersion = std::string(WSJCPP_VERSION);
1010

11-
// TODO
11+
std::string sSource = "some123";
12+
std::string sSha1 = WSJCppHashes::sha1_calc_hex(sSource);
13+
std::string sMd5 = WSJCppHashes::md5_calc_hex(sSource);
14+
std::cout << "sha1('" << sSource << "') = " << sSha1 << std::endl;
15+
std::cout << "md5('" << sSource << "') = " << sMd5 << std::endl;
1216

1317
return 0;
1418
}

0 commit comments

Comments
 (0)