Skip to content

Commit

Permalink
Hash: make actual SHA1 result and comment consistent (#5057)
Browse files Browse the repository at this point in the history
fixes #3437
  • Loading branch information
yoursunny authored and devyte committed Aug 26, 2018
1 parent 18f643c commit 0da54d8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions libraries/Hash/examples/sha1/sha1.ino
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
#include <Hash.h>

void setup() {
Serial.begin(921600);
Serial.begin(115200);
}

void loop() {

// usage as String
// SHA1:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
// SHA1:a9993e364706816aba3e25717850c26c9cd0d89d

Serial.print("SHA1:");
Serial.println(sha1("abc"));

// usage as ptr
// SHA1:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
uint8_t hash[20];
sha1("abc", &hash[0]);
sha1("test", &hash[0]);

Serial.print("SHA1:");
for (uint16_t i = 0; i < 20; i++) {
Expand All @@ -29,4 +29,3 @@ void loop() {

delay(1000);
}

0 comments on commit 0da54d8

Please sign in to comment.