Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 28 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,46 @@ Installation:
Restart Arduino to rescan for new libraries.

Using SHA-1:
#include "sha1.h"
...
uint8_t *hash;
Sha1.init();
Sha1.print("This is a message to hash");
hash = Sha1.result();

#include "sha1.h"
...
uint8_t *hash;
Sha1.init();
Sha1.print("This is a message to hash");
hash = Sha1.result();

The hash result is then stored in hash[0], hash[1] .. hash[19].

Using HMAC-SHA-1:
#include "sha1.h"
...
uint8_t *hash;
Sha1.initHmac("hash key",8); // key, and length of key in bytes
Sha1.print("This is a message to hash");
hash = Sha1.resultHmac();

#include "sha1.h"
...
uint8_t *hash;
Sha1.initHmac("hash key",8); // key, and length of key in bytes
Sha1.print("This is a message to hash");
hash = Sha1.resultHmac();

The hash result is then stored in hash[0], hash[1] .. hash[19].

Using SHA-256:
#include "sha256.h"
...
uint8_t *hash;
Sha256.init();
Sha256.print("This is a message to hash");
hash = Sha256.result();

#include "sha256.h"
...
uint8_t *hash;
Sha256.init();
Sha256.print("This is a message to hash");
hash = Sha256.result();

The hash result is then stored in hash[0], hash[1] .. hash[31].

Using HMAC-SHA-256:
#include "sha256.h"
...
uint8_t *hash;
Sha256.initHmac("hash key",8); // key, and length of key in bytes
Sha256.print("This is a message to hash");
hash = Sha256.resultHmac();

#include "sha256.h"
...
uint8_t *hash;
Sha256.initHmac("hash key",8); // key, and length of key in bytes
Sha256.print("This is a message to hash");
hash = Sha256.resultHmac();

The hash result is then stored in hash[0], hash[1] .. hash[31].

Expand Down