0.2.5 Adler

This commit is contained in:
Rob Tillaart 2024-03-28 19:46:15 +01:00
parent 7c3a797cfb
commit 0557f4aa7b
25 changed files with 101 additions and 27 deletions

View File

@ -1,4 +1,4 @@
# These are supported funding model platforms
github: RobTillaart
custom: "https://www.paypal.me/robtillaart"

View File

@ -5,8 +5,9 @@ on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: arduino/arduino-lint-action@v1
with:
library-manager: update

View File

@ -6,9 +6,10 @@ on: [push, pull_request]
jobs:
runTest:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

View File

@ -9,10 +9,11 @@ on:
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: json-syntax-check
uses: limitusus/json-syntax-check@v1
uses: limitusus/json-syntax-check@v2
with:
pattern: "\\.json$"

View File

@ -1,7 +1,7 @@
//
// FILE: Adler.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.2.4
// VERSION: 0.2.5
// DATE: 2022-01-27
// PURPOSE: Arduino Library for calculating Adler checksum
// URL: https://github.com/RobTillaart/Adler

View File

@ -2,7 +2,7 @@
//
// FILE: Adler.h
// AUTHOR: Rob Tillaart
// VERSION: 0.2.4
// VERSION: 0.2.5
// DATE: 2022-01-27
// PURPOSE: Arduino Library for calculating Adler checksum
// URL: https://github.com/RobTillaart/Adler
@ -12,7 +12,7 @@
#include "Arduino.h"
#define ADLER_LIB_VERSION (F("0.2.4"))
#define ADLER_LIB_VERSION (F("0.2.5"))
const uint32_t ADLER32_MOD_PRIME = 65521;

View File

@ -1,7 +1,7 @@
//
// FILE: Adler16.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.2.4
// VERSION: 0.2.5
// DATE: 2022-06-14
// PURPOSE: Arduino Library for calculating Adler-16 checksum
// URL: https://github.com/RobTillaart/Adler

View File

@ -1,8 +1,8 @@
#pragma once
//
// FILE: Adler16.cpp
// FILE: Adler16.h
// AUTHOR: Rob Tillaart
// VERSION: 0.2.4
// VERSION: 0.2.5
// DATE: 2022-06-15
// PURPOSE: Arduino Library for calculating Adler-16 checksum
// URL: https://github.com/RobTillaart/Adler
@ -13,7 +13,7 @@
#include "Arduino.h"
#define ADLER16_LIB_VERSION (F("0.2.4"))
#define ADLER16_LIB_VERSION (F("0.2.5"))
// largest prime below 2^8

View File

@ -1,7 +1,7 @@
//
// FILE: Adler32.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.2.4
// VERSION: 0.2.5
// DATE: 2022-01-27
// PURPOSE: Arduino Library for calculating Adler-32 checksum
// URL: https://github.com/RobTillaart/Adler

View File

@ -1,8 +1,8 @@
#pragma once
//
// FILE: Adler.h
// FILE: Adler32.h
// AUTHOR: Rob Tillaart
// VERSION: 0.2.4
// VERSION: 0.2.5
// DATE: 2022-01-27
// PURPOSE: Arduino Library for calculating Adler-32 checksum
// URL: https://github.com/RobTillaart/Adler
@ -12,7 +12,7 @@
#include "Arduino.h"
#define ADLER32_LIB_VERSION (F("0.2.4"))
#define ADLER32_LIB_VERSION (F("0.2.5"))
// largest prime below 2^16

View File

@ -6,13 +6,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.2.5] - 2024-03-28
- update GitHub actions
- add 0.2.5 performance tests
- minor edits
## [0.2.4] - 2023-10-15
- update readme.md
- add static wrappers for char arrays
- update keywords.txt
- minor edits
## [0.2.3] - 2023-01-16
- update GitHub actions
- update license

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2022-2023 Rob Tillaart
Copyright (c) 2022-2024 Rob Tillaart
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -229,7 +229,7 @@ Adler16 does more often the modulo math as it reaches halfway uint16_t
faster than Adler32 reaches halfway uint32_t.
As the Adler16 is less performant as the Adler32 (on all tested platforms),
it is often the best choice to use the 32 bit version.
Adler32 is often the best choice to use the 32 bit version.
## Operation

View File

@ -0,0 +1,22 @@
Adler16_performance
ADLER16_LIB_VERSION: 0.2.5
randomtime: 901480
total: 941072
1e4 x add: 39592
checksum: 6798
total: 5000108
1e6 x add: 4098628
checksum: 5028
LENGTH LOREM: 868
lorem 1: 3600 checksum: 57303
lorem 2: 4040 checksum: 57303
lorem 3: 1968 checksum: 57303
LENGTH HELLO: 11
hello 1: 48 checksum: 36209
hello 2: 52 checksum: 36209
hello 3: 48 checksum: 36209

View File

@ -8,6 +8,7 @@
#include "Arduino.h"
#include "Adler16.h"
// expected output
// Adler16_test
// ADLER16_LIB_VERSION: 0.2.0
@ -22,6 +23,7 @@ uint8_t arr1[5] = { 100, 120, 130, 135, 140 };
uint8_t arr2[5] = { 101, 120, 130, 135, 140 }; // minimal diff.
uint8_t arr3[5] = { 100, 120, 130, 135, 141 }; // minimal diff.
void setup()
{
Serial.begin(115200);

View File

@ -10,6 +10,7 @@
Adler32 ad;
volatile uint8_t z;
uint32_t start, stop, randomtime;
@ -32,7 +33,6 @@ nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui.";
char hello[] = "hello world";
void setup()
{
Serial.begin(115200);
@ -170,7 +170,6 @@ void setup()
Serial.println(ad.getAdler());
Serial.println();
}

View File

@ -0,0 +1,22 @@
Adler32_performance
ADLER32_LIB_VERSION: 0.2.5
randomtime: 901480
total: 960236
1e4 x add: 58756
checksum: 1607808947
total: 6919548
1e6 x add: 6018068
checksum: 237492440
LENGTH LOREM: 868
lorem 1: 5308 checksum: 3972480156
lorem 2: 5640 checksum: 3972480156
lorem 3: 1344 checksum: 3972480156
LENGTH HELLO: 11
hello 1: 68 checksum: 436929629
hello 2: 72 checksum: 436929629
hello 3: 32 checksum: 436929629

View File

@ -42,7 +42,7 @@ void setup()
Serial.print("ADLER32_LIB_VERSION: ");
Serial.println(ADLER32_LIB_VERSION);
// to compare footprint
// to compare footprint
// ad.add(lorem, strlen(lorem));
ad.addFast(lorem, strlen(lorem));
}

View File

@ -4,24 +4,26 @@
// PURPOSE: demo
// URL: https://github.com/RobTillaart/Adler
#include "Arduino.h"
#include "Adler32.h"
// expected output
// Adler32_test
// ADLER32_LIB_VERSION: 0.2.0
// ADLER32_LIB_VERSION: 0.2.5
// 116982386
// 117310067
// 117047923
Adler32 ad;
uint8_t arr1[5] = { 100, 120, 130, 135, 140 };
uint8_t arr2[5] = { 101, 120, 130, 135, 140 }; // minimal diff.
uint8_t arr3[5] = { 100, 120, 130, 135, 141 }; // minimal diff.
void setup()
{
Serial.begin(115200);

View File

@ -4,9 +4,11 @@
// PURPOSE: demo
// URL: https://github.com/RobTillaart/Adler
#include "Arduino.h"
#include "Adler.h"
char str[] = "Lorem ipsum dolor sit amet, \
consectetuer adipiscing elit. Aenean commodo ligula eget dolor. \
Aenean massa. Cum sociis natoque penatibus et magnis dis parturient \
@ -25,6 +27,7 @@ nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui.";
uint32_t start, stop;
void setup()
{
Serial.begin(115200);
@ -77,4 +80,3 @@ void loop()
// -- END OF FILE --

View File

@ -0,0 +1,15 @@
Tested on Arduino UNO
IDE 1.18.19
D:\Rob\WORK\Arduino\libraries\Adler\examples\Adler_performance\Adler_performance.ino
ADLER_LIB_VERSION: 0.2.5
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ae...
LENGTH STR: 868
TIME us: 1116
ADLER-32: 3972480156 ECC73C9C
TIME us: 1740
ADLER-16: 57303 DFD7

View File

@ -4,6 +4,7 @@
// PURPOSE: demo
// URL: https://github.com/RobTillaart/Adler
#include "Arduino.h"
#include "Adler.h"

View File

@ -21,6 +21,7 @@ count KEYWORD2
# Constants (LITERAL1)
ADLER32_LIB_VERSION LITERAL1
ADLER16_LIB_VERSION LITERAL1
ADLER32_MOD_PRIME LITERAL1
ADLER16_MOD_PRIME LITERAL1

View File

@ -15,7 +15,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/Adler.git"
},
"version": "0.2.4",
"version": "0.2.5",
"license": "MIT",
"frameworks": "*",
"platforms": "*",

View File

@ -1,5 +1,5 @@
name=Adler
version=0.2.4
version=0.2.5
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino Library for calculating Adler-32 and Adler-16 checksum.