mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-27 18:02:17 +03:00
examples: format all .ino files
This formats all the example source files using Arduino style rules.
This commit is contained in:
committed by
Ivan Grokhotkov
parent
e226251b27
commit
61cd8d8385
@ -1,32 +1,32 @@
|
||||
/**
|
||||
* simple demo to show sha1 calculation
|
||||
*/
|
||||
simple demo to show sha1 calculation
|
||||
*/
|
||||
#include <Arduino.h>
|
||||
#include <Hash.h>
|
||||
|
||||
void setup() {
|
||||
Serial.begin(921600);
|
||||
Serial.begin(921600);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
// usage as String
|
||||
// SHA1:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
|
||||
// usage as String
|
||||
// SHA1:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
|
||||
|
||||
Serial.print("SHA1:");
|
||||
Serial.println(sha1("abc"));
|
||||
Serial.print("SHA1:");
|
||||
Serial.println(sha1("abc"));
|
||||
|
||||
// usage as ptr
|
||||
// SHA1:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
|
||||
uint8_t hash[20];
|
||||
sha1("abc", &hash[0]);
|
||||
// usage as ptr
|
||||
// SHA1:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
|
||||
uint8_t hash[20];
|
||||
sha1("abc", &hash[0]);
|
||||
|
||||
Serial.print("SHA1:");
|
||||
for(uint16_t i = 0; i < 20; i++) {
|
||||
Serial.printf("%02x", hash[i]);
|
||||
}
|
||||
Serial.println();
|
||||
Serial.print("SHA1:");
|
||||
for (uint16_t i = 0; i < 20; i++) {
|
||||
Serial.printf("%02x", hash[i]);
|
||||
}
|
||||
Serial.println();
|
||||
|
||||
delay(1000);
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user