Skip to content

Commit

Permalink
Updated README. Added gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
apense committed May 24, 2015
1 parent 951acc0 commit edfbc38
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.exe
**/nimcache
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
# ShimSham

ShimSham
========

ShimSham is a Nim module to encompass several different digest/hashing algorithms. So far included are [Sha2](https://en.wikipedia.org/wiki/SHA-2), [Tiger](https://en.wikipedia.org/wiki/Tiger_%28cryptography%29), and [Whirlpool](https://en.wikipedia.org/wiki/Whirlpool_%28cryptography%29). Hopefully there will be some more soon.
ShimSham is a Nim module to encompass several different digest/hashing algorithms. So far included are [Sha2](https://en.wikipedia.org/wiki/SHA-2), [Tiger](https://en.wikipedia.org/wiki/Tiger_%28cryptography%29), and [Whirlpool](https://en.wikipedia.org/wiki/Whirlpool_%28cryptography%29). Hopefully there will be some more soon.

Unfortunately, there isn't a common access interface yet. A fuller README and some usage examples will come soon.

For Sha256 (of SHA-2), try:

```nim
import sha256
var message = "My message to hash"
var m = initSha256(message) ## initializes and `Sha256` object with `message`
echo m ## gives "aefd1872a4eb24a79a1e727aa8c41ebde794451c0ca89a0e3abe82e45a477afc"
```
You can also use `initSha224` if that's what you want.

`initSha384` and `initSha512` are available in the sha512 module.

`initWhirlpool` works in the same way.

For the Tiger hash, here's how you call:
```nim
import tiger
echo tiger("") ## gives "24f0130c63ac933216166e76b1bb925ff373de2d49584e7a"
```

The Tiger hash way seems cleaner, and all functions might switch to that soon.
Binary file removed sha256/sha256.exe
Binary file not shown.
Binary file removed sha512/sha512.exe
Binary file not shown.
Binary file removed tiger/tiger.exe
Binary file not shown.
Binary file removed whirlpool/whirlpool.exe
Binary file not shown.

0 comments on commit edfbc38

Please sign in to comment.