Skip to content

Commit a6fcc53

Browse files
committed
Fixed generic SHA1 name causing conflicts with other libraries
1 parent d7a68ae commit a6fcc53

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Diff for: examples/SHA1/SHA1.ino

+8-8
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ void printSHA1(const char* str) {
3434
Serial.print(str);
3535
Serial.print("' is 0x");
3636

37-
SHA1.beginHash();
38-
SHA1.print(str);
39-
SHA1.endHash();
37+
BearSHA1.beginHash();
38+
BearSHA1.print(str);
39+
BearSHA1.endHash();
4040

4141
printResult();
4242
}
@@ -48,17 +48,17 @@ void printHMACSHA1(const char* secret, const char* str) {
4848
Serial.print(secret);
4949
Serial.print("' is 0x");
5050

51-
SHA1.beginHmac(secret);
52-
SHA1.print(str);
53-
SHA1.endHmac();
51+
BearSHA1.beginHmac(secret);
52+
BearSHA1.print(str);
53+
BearSHA1.endHmac();
5454

5555
printResult();
5656
}
5757

5858
void printResult()
5959
{
60-
while (SHA1.available()) {
61-
byte b = SHA1.read();
60+
while (BearSHA1.available()) {
61+
byte b = BearSHA1.read();
6262

6363
if (b < 16) {
6464
Serial.print("0");

Diff for: src/SHA1.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ int SHA1Class::end(uint8_t *digest)
5454
return 1;
5555
}
5656

57-
SHA1Class SHA1;
57+
SHA1Class BearSHA1;

Diff for: src/SHA1.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ class SHA1Class: public SHAClass {
4747
br_sha1_context _ctx;
4848
};
4949

50-
extern SHA1Class SHA1;
50+
extern SHA1Class BearSHA1;
5151

5252
#endif

0 commit comments

Comments
 (0)