Function Adler32(sBuffer$) As Long
Dim Seed As Long
Dim S1 As Long
Dim S2 As Long
Dim N As Long
Dim CrcBase As Long
CrcBase = 65521
Seed = 1
S1 = Seed And &HFFFF
S2 = (Seed / 65536) And &HFFFF
For N = 1 To Len(sBuffer$)
S1 = (S1 + Asc(Mid$(sBuffer$, N, 1))) Mod CrcBase
S2 = (S2 + S1) Mod CrcBase
Next
Adler32 = (S2 * 65536) + S1
End Function
No comments:
Post a Comment