ADLER32: Difference between revisions
Jump to navigation
Jump to search
Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link
No edit summary |
No edit summary |
||
Line 17: | Line 17: | ||
** All double bit flips will be detected. | ** All double bit flips will be detected. | ||
** Burst errors up to seven bits are always detected. | ** Burst errors up to seven bits are always detected. | ||
* For more informations have a closer look at [https://www.intel.com/content/www/us/en/content-details/709921/intel-quickassist-technology-intel-qat-using-adler-32-checksum-and-crc32-hash-to-ensure-data-compression-integrity.html | * For more informations have a closer look at [https://www.intel.com/content/www/us/en/content-details/709921/intel-quickassist-technology-intel-qat-using-adler-32-checksum-and-crc32-hash-to-ensure-data-compression-integrity.html Chapters 5-7 here]. | ||
Revision as of 20:09, 2 February 2024
The _ADLER32 function returns the Adler-32 checksum of any arbitrary string.
Syntax
- chksum~& = _ADLER32(dataString$)
Parameters
- chksum~& is the _UNSIGNED LONG checksum returned (zero, if the given dataString$ was empty).
- dataString$ is any literal or variable STRING to build the checksum from.
Description
- The Adler-32 checksum uses a relative simple but very fast algorithm, it has the following known properties:
- All single bit flips will be detected.
- All double bit flips will be detected.
- Burst errors up to seven bits are always detected.
- For more informations have a closer look at Chapters 5-7 here.
Availability
Examples
- Example
- Showing how the Adler-32 checksum can detect differences in two strings.
'this is the correct text t$ = "QB64 Phoenix Edition" PRINT "Correct Text: "; t$ PRINT "Adler-32 Sum: "; RIGHT$("00000000" + HEX$(_ADLER32(t$)), 8) PRINT 'this text differs in just 1 bit from the above, by changing 4 to 5 'ASC("4") = 52 = &B00110100 'ASC("5") = 53 = &B00110101 t$ = "QB65 Phoenix Edition" PRINT "Mangled Text: "; t$ PRINT "Adler-32 Sum: "; RIGHT$("00000000" + HEX$(_ADLER32(t$)), 8) END |
Correct Text: QB64 Phoenix Edition Adler-32 Sum: 41F806E5 Mangled Text: QB65 Phoenix Edition Adler-32 Sum: 420906E6 |
See also