GY-63_MS5611/libraries/Adler/examples/Adler_test/Adler_test.ino
2022-06-16 09:46:28 +02:00

62 lines
1.1 KiB
C++

//
// FILE: Adler_test.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo
#include "Arduino.h"
#include "Adler.h"
// expected output
// ADLER_LIB_VERSION: 0.2.0
//
// E1F5
// 4660
// 4634
// 40A7
//
// 5C801F0
// 81E0256
// E000325
// 11E60398
char str1[24] = "abcde";
char str2[24] = "abcdef";
char str3[24] = "abcdefgh";
char str4[24] = "Wikipedia"; // example from Wikipedia page.
void setup()
{
Serial.begin(115200);
while (!Serial);
Serial.println();
Serial.print("ADLER_LIB_VERSION: ");
Serial.println(ADLER_LIB_VERSION);
Serial.println();
Serial.println(adler16((uint8_t *) str1, 5), HEX);
Serial.println(adler16((uint8_t *) str2, 6), HEX);
Serial.println(adler16((uint8_t *) str3, 8), HEX);
Serial.println(adler16((uint8_t *) str4, 9), HEX);
Serial.println();
Serial.println(adler32((uint8_t *) str1, 5), HEX);
Serial.println(adler32((uint8_t *) str2, 6), HEX);
Serial.println(adler32((uint8_t *) str3, 8), HEX);
Serial.println(adler32((uint8_t *) str4, 9), HEX);
Serial.println();
}
void loop()
{
}
// -- END OF FILE --