Skip to content

Commit

Permalink
fix: linting error
Browse files Browse the repository at this point in the history
  • Loading branch information
helgeerbe committed Jul 4, 2023
1 parent d3adc65 commit 344498d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/HttpPowerMeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,16 +235,18 @@ float HttpPowerMeterClass::getFloatValueByJsonPath(const char* jsonString, const
}
}

#define HASH_SIZE 32

String HttpPowerMeterClass::sha256(const String& data) {
SHA256 sha256;
uint8_t hash[sha256.HASH_SIZE];
uint8_t hash[HASH_SIZE];

sha256.reset();
sha256.update(data.c_str(), data.length());
sha256.finalize(hash, sha256.HASH_SIZE);
sha256.finalize(hash, HASH_SIZE);

String hashStr = "";
for (int i = 0; i < sha256.HASH_SIZE; i++) {
for (int i = 0; i < HASH_SIZE; i++) {
String hex = String(hash[i], HEX);
if (hex.length() == 1) {
hashStr += "0";
Expand Down

0 comments on commit 344498d

Please sign in to comment.