8000 Hash: make actual SHA1 result and comment consistent by yoursunny · Pull Request #5057 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Hash: make actual SHA1 result and comment consistent #5057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 26, 2018
Merged
Changes from 1 commit
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
Next Next commit
Hash: make actual SHA1 result and comment consistent
fixes #3437
  • Loading branch information
yoursunny committed Aug 18, 2018
commit 4a31dcc816123c9687be43a195487feeb0a13301
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