|
Class: CRC8Stream
Object
|
+--Stream
|
+--HashStream
|
+--CRCStream
|
+--CRC8Stream
- Package:
- stx:libbasic2
- Category:
- System-Crypt-Hashing
- Version:
- rev:
1.5
date: 2023/11/29 15:21:59
- user: cg
- file: CRC8Stream.st directory: libbasic2
- module: stx stc-classLibrary: libbasic2
newSAE_J1850:
Standard CRC method as defined by SAE J1850 (used in AUTOSAR)
The polynomial is 0x1D; initial value 0xFF; xorOut is 0xFF
[instance variables:]
[class variables:]
copyrightCOPYRIGHT (c) 2019 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
instance creation
-
generatorPolynomMSB: anInteger
-
notice, in literature, the generator polynom is usually specified as an MSB number
-
generatorPolynomMSB: anInteger initValue: initValue
-
notice, in literature, the generator polynom is usually specified as an MSB number
-
generatorPolynomMSB: anInteger initValue: initValueArg xorOut: xorOut
-
notice, in literature, the generator polynom is usually specified as an MSB number
-
newSAE_J1850
-
return an instance of the SAE_J1850 CRC8 (used in AUTOSAR)
-
new_2F
-
return an instance of the CRC8-2F (used in AUTOSAR).
Currently broken.
queries
-
hashSize
-
return the size of the hashvalue returned by instances of this class (in bytes)
initialization
-
generatorPolynom: anLSBInteger
-
set the generator polynom for this instance,
set start and xorOut to 16rFF.
Note: you have to set the bit-reversed value, so the LSB must be first
-
generatorPolynom: anLSBInteger initValue: initValueArg
-
set the generator polynom for this instance.
set start to initValueArg and xorOut to 16rFF.
Note: you have to set the bit-reversed value, so the LSB must be first
-
reset
-
(comment from inherited method)
reset the current crc value
queries
-
hashValue
-
return the computed CRC
writing
-
nextPutByte: byte
-
(comment from inherited method)
add the hash of anObject to the computed hash so far.
aByte can be a SmallInteger <= 255
-
nextPutBytes: count from: anObject startingAt: start
-
(comment from inherited method)
add the hash of anObject to the computed hash so far.
self assert:(CRC8Stream newSAE_J1850 hashValueOf:#[16rF2 16r01 16r83]) = 16r37.
= 55
|
|