CRCStream.st
author Claus Gittinger <cg@exept.de>
Sat, 16 Mar 2019 23:42:33 +0100
changeset 4859 24002e2a232a
parent 4856 e72f2607ef37
child 4860 aba42206dea6
permissions -rw-r--r--
#QUALITY by cg class: CRCStream class added: #flushCrcTables
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4846
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
     1
"{ Encoding: utf8 }"
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
     2
4844
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"{ Package: 'stx:libbasic2' }"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
"{ NameSpace: Smalltalk }"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
HashStream subclass:#CRCStream
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
	instanceVariableNames:'crc generatorPolynom crcTable initValue xorOut'
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
	classVariableNames:''
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
	poolDictionaries:''
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
	category:'System-Crypt-Hashing'
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
!
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
CRCStream class instanceVariableNames:'crcTables'
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
 No other class instance variables are inherited by this class.
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!CRCStream class methodsFor:'documentation'!
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
documentation
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
    abstract superclass of crc streams;
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
    refactored from original crc32 stream.
4856
e72f2607ef37 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
    27
    For details, see https://en.wikipedia.org/wiki/Cyclic_redundancy_check
4844
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
! !
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
!CRCStream class methodsFor:'initialization'!
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
crcTableFor:generatorPolynomInteger
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
    |crcTable|
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
    crcTables isNil ifTrue:[
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
        crcTables := Dictionary new
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
    ].    
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
    crcTable := (crcTables at:generatorPolynomInteger ifAbsent:nil).
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
    crcTable isNil ifTrue:[
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
        crcTable := IntegerArray new:256.
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
        0 to:255 do:[:count| |i|
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
            i := count.
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
            8 timesRepeat:[
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
                (i bitTest:1) ifTrue:[
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
                    i := generatorPolynomInteger bitXor:(i bitShift:-1)
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
                ] ifFalse:[
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
                    i := i bitShift:-1
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
                ]
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
            ].
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
            crcTable at:count+1 put:i.
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
        ].
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
        crcTables at:generatorPolynomInteger put:crcTable.
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
    ].
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    ^ crcTable.
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    "Created: / 16-03-2019 / 20:53:51 / Claus Gittinger"
4859
24002e2a232a #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4856
diff changeset
    59
!
24002e2a232a #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4856
diff changeset
    60
24002e2a232a #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4856
diff changeset
    61
flushCrcTables
24002e2a232a #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4856
diff changeset
    62
    crcTables := nil.
24002e2a232a #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4856
diff changeset
    63
24002e2a232a #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4856
diff changeset
    64
    "
24002e2a232a #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4856
diff changeset
    65
     CRC16Stream flushCrcTables
24002e2a232a #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4856
diff changeset
    66
     CRC32Stream flushCrcTables
24002e2a232a #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4856
diff changeset
    67
    "
24002e2a232a #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4856
diff changeset
    68
24002e2a232a #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4856
diff changeset
    69
    "Created: / 16-03-2019 / 23:41:19 / Claus Gittinger"
4844
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
! !
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
!CRCStream class methodsFor:'instance creation'!
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
generatorPolynom:anLSBInteger
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
    "notice, in literature, the generator polynom is usually specified as an MSB number"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
    ^ self basicNew generatorPolynom:anLSBInteger
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
    "
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
       self assert:((self generatorPolynom:16r82F63B78)
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
                                nextPut:'123456789';
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
                                hashValue)    = 16rE3069283
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    "
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
    "Modified (comment): / 16-03-2019 / 20:56:23 / Claus Gittinger"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
!
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
generatorPolynom:anLSBInteger initValue:initValue
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
    "notice, in literature, the generator polynom is usually specified as an MSB number"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
    ^ self basicNew generatorPolynom:anLSBInteger initValue:initValue
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
    "
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
       self assert:((self generatorPolynom:16r82F63B78)
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
                                nextPut:'123456789';
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
                                hashValue)    = 16rE3069283
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
    "
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
    "Created: / 16-03-2019 / 21:15:54 / Claus Gittinger"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
!
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
generatorPolynom:anLSBInteger initValue:initValue xorOut:xorOut
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
    "notice, in literature, the generator polynom is usually specified as an MSB number"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
    ^ self basicNew generatorPolynom:anLSBInteger initValue:initValue xorOut:xorOut
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
    "
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
       self assert:((self generatorPolynom:16r82F63B78)
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
                                nextPut:'123456789';
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
                                hashValue)    = 16rE3069283
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
    "
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
    "Created: / 16-03-2019 / 21:16:05 / Claus Gittinger"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
! !
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
!CRCStream methodsFor:'accessing'!
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
generatorPolynom
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
    "answer the generator polynom (LSB)"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
    ^ generatorPolynom
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
    "Modified (comment): / 16-03-2019 / 20:58:10 / Claus Gittinger"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
!
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
initValue
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
    "answer the init value"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
    ^ initValue ? 0
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
    "Created: / 16-03-2019 / 21:05:04 / Claus Gittinger"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
!
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
xorOut
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
    "answer the xorOut value"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
    ^ xorOut ? 16rFFFFFFFF
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
    "Created: / 16-03-2019 / 21:16:23 / Claus Gittinger"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
! !
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
!CRCStream methodsFor:'initialization'!
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
generatorPolynom:polyLSB initValue:initValueArg xorOut:xorOutArg
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
    "answer the generator polynom (LSB)"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
    generatorPolynom := polyLSB.
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
    crc := initValue := initValueArg.
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
    xorOut := xorOutArg.
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
    crcTable := self class crcTableFor:generatorPolynom.
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
    "Created: / 16-03-2019 / 21:17:12 / Claus Gittinger"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
!
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
reset
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
    "reset the current crc value"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
    crc := initValue.
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
    "Created: / 16-03-2019 / 21:25:27 / Claus Gittinger"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
! !
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
!CRCStream methodsFor:'queries'!
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
hashValue
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
    "return the computed CRC"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
    ^ crc bitXor:xorOut.
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
    "Modified: / 16-03-2019 / 21:27:59 / Claus Gittinger"
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
! !
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
4846
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   174
!CRCStream methodsFor:'writing'!
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   175
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   176
nextPutBytes:count from:anObject startingAt:start
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   177
    "add the hash of anObject to the computed hash so far."
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   178
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   179
%{
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   180
    if (__bothSmallInteger(count, start)) {
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   181
        int len, offs;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   182
        int objSize;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   183
        unsigned char *extPtr;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   184
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   185
        len = __intVal(count);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   186
        offs = __intVal(start) - 1;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   187
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   188
        if (__isExternalBytesLike(anObject)) {
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   189
            OBJ sz = __externalBytesSize(anObject);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   190
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   191
            extPtr = (unsigned char *)__externalBytesAddress(anObject);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   192
            if (__isSmallInteger(sz)) {
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   193
                objSize = __intVal(sz);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   194
            } else {
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   195
                objSize = 0; /* unknown */
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   196
            }
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   197
        } else {
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   198
            int nInstVars, nInstBytes;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   199
            OBJ oClass = __Class(anObject);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   200
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   201
            switch (__intVal(__ClassInstPtr(oClass)->c_flags) & ARRAYMASK) {
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   202
                case BYTEARRAY:
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   203
                case WORDARRAY:
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   204
                case LONGARRAY:
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   205
                case SWORDARRAY:
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   206
                case SLONGARRAY:
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   207
                case FLOATARRAY:
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   208
                case DOUBLEARRAY:
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   209
                    break;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   210
                default:
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   211
                    goto bad;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   212
            }
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   213
            nInstVars = __intVal(__ClassInstPtr(oClass)->c_ninstvars);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   214
            nInstBytes = __OBJS2BYTES__(nInstVars);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   215
            // nInstBytes is the number of bytes occupied by pointer instance variables
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   216
            // subtract from size and add to byte-pointer
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   217
            objSize = __qSize(anObject) - OHDR_SIZE - nInstBytes;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   218
            extPtr = (unsigned char *)__byteArrayVal(anObject)+nInstBytes;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   219
        }
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   220
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   221
        if ((offs >= 0) && (len >= 0) && (objSize >= (len + offs))) {
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   222
            unsigned int _crc;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   223
            unsigned int *_crcTable = __integerArrayVal( __INST(crcTable) );
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   224
            unsigned char *cp = extPtr+offs;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   225
            unsigned int n = len;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   226
4856
e72f2607ef37 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   227
            if (__isSmallInteger(__INST(crc))) {
4846
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   228
                _crc = (unsigned int) (__intVal( __INST(crc) ));
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   229
            } else {
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   230
                _crc = __unsignedLongIntVal( __INST(crc) );
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   231
            }
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   232
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   233
#ifdef __LSBFIRST__
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   234
# if __POINTER_SIZE__ == 8
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   235
            if (((unsigned INT)cp & 7) == 0) {
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   236
                // longword aligned
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   237
                for ( ; n >= 8 ; n -= 8, cp += 8) {
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   238
                    unsigned INT lWord;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   239
                    unsigned char _idx;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   240
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   241
                    lWord = ((unsigned INT *)cp)[0];
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   242
                    _idx = (_crc ^ lWord) & 0xFF;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   243
                    _crc = _crcTable[_idx] ^ (_crc >> 8);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   244
                    _idx = (_crc ^ (lWord>>8)) & 0xFF;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   245
                    _crc = _crcTable[_idx] ^ (_crc >> 8);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   246
                    _idx = (_crc ^ (lWord>>16)) & 0xFF;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   247
                    _crc = _crcTable[_idx] ^ (_crc >> 8);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   248
                    _idx = (_crc ^ (lWord>>24)) & 0xFF;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   249
                    _crc = _crcTable[_idx] ^ (_crc >> 8);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   250
                    
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   251
                    _idx = (_crc ^ (lWord>>32)) & 0xFF;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   252
                    _crc = _crcTable[_idx] ^ (_crc >> 8);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   253
                    _idx = (_crc ^ (lWord>>40)) & 0xFF;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   254
                    _crc = _crcTable[_idx] ^ (_crc >> 8);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   255
                    _idx = (_crc ^ (lWord>>48)) & 0xFF;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   256
                    _crc = _crcTable[_idx] ^ (_crc >> 8);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   257
                    _idx = (_crc ^ (lWord>>56)) & 0xFF;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   258
                    _crc = _crcTable[_idx] ^ (_crc >> 8);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   259
                }
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   260
            }
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   261
# endif            
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   262
            if (((unsigned INT)cp & 3) == 0) {
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   263
                // word aligned
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   264
                for ( ; n >= 4 ; n -= 4, cp += 4) {
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   265
                    unsigned int word;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   266
                    unsigned char _idx;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   267
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   268
                    word = ((unsigned int *)cp)[0];
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   269
                    _idx = (_crc ^ word) & 0xFF;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   270
                    _crc = _crcTable[_idx] ^ (_crc >> 8);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   271
                    _idx = (_crc ^ (word>>8)) & 0xFF;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   272
                    _crc = _crcTable[_idx] ^ (_crc >> 8);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   273
                    _idx = (_crc ^ (word>>16)) & 0xFF;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   274
                    _crc = _crcTable[_idx] ^ (_crc >> 8);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   275
                    _idx = (_crc ^ (word>>24)) & 0xFF;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   276
                    _crc = _crcTable[_idx] ^ (_crc >> 8);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   277
                }
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   278
            }
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   279
#endif
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   280
            for ( ; n >= 4 ; n -= 4, cp += 4) {
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   281
                unsigned char _idx;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   282
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   283
                _idx = (_crc ^ cp[0]) & 0xFF;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   284
                _crc = _crcTable[_idx] ^ (_crc >> 8);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   285
                _idx = (_crc ^ cp[1]) & 0xFF;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   286
                _crc = _crcTable[_idx] ^ (_crc >> 8);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   287
                _idx = (_crc ^ cp[2]) & 0xFF;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   288
                _crc = _crcTable[_idx] ^ (_crc >> 8);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   289
                _idx = (_crc ^ cp[3]) & 0xFF;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   290
                _crc = _crcTable[_idx] ^ (_crc >> 8);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   291
            }
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   292
            while (n-- > 0) {
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   293
                unsigned char _idx = (_crc ^ *cp++) & 0xFF;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   294
                _crc = _crcTable[_idx] ^ (_crc >> 8);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   295
            }
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   296
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   297
            if (sizeof(INT) == 8 || _crc <= _MAX_INT)
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   298
                __INST(crc) = __MKSMALLINT(_crc);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   299
            else {
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   300
                // this code fails with gcc 4.7.2:
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   301
                // __INST(crc) = __MKUINT(_crc); __STORESELF(crc);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   302
                OBJ temp = __MKUINT(_crc); 
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   303
                __INST(crc) = temp; __STORESELF(crc);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   304
            }
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   305
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   306
            // if (__unsignedLongIntVal(__INST(crc)) == 4294967295) printf("inst: %d crc: %d new: %d\n", __unsignedLongIntVal(__INST(crc)), _crc, __unsignedLongIntVal(temp));
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   307
            RETURN (count);
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   308
        }
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   309
    }
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   310
bad: ;
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   311
%}.
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   312
    self error:'invalid argument'
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   313
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   314
    "Created: / 09-01-2012 / 16:48:35 / cg"
4856
e72f2607ef37 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   315
    "Modified: / 16-03-2019 / 23:19:17 / Claus Gittinger"
4846
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   316
! !
f5b34b8c44e3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4844
diff changeset
   317
4844
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
!CRCStream class methodsFor:'documentation'!
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
version_CVS
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
    ^ '$Header$'
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
! !
3b189f2e8b7a initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323