Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:include\linux\zutil.h Create Date:2022-07-28 06:16:34
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Update a running Adler-32 checksum with the bytes buf[0..len-1] andreturn the updated checksum. If buf is NULL, this function returnsthe required initial value for the checksum.An Adler-32 checksum is almost as reliable as a CRC32 but can be computed

Proto:static inline uLong zlib_adler32(uLong adler, const Byte *buf, uInt len)

Type:uLong

Parameter:

TypeParameterName
uLongadler
const Byte *buf
uIntlen
82  s1 = adler & 0xffff
83  s2 = adler >> 16 & 0xffff
86  If (buf == NULL) Then Return 1L
88  When len > 0 cycle
89  k = If len < NMAX Then len Else NMAX
90  len -= k
91  When k >= 16 cycle
93  buf += 16
94  k -= 16
96  If k != 0 Then Do
97  s1 += buf++
98  s2 += s1
99  When --k cycle
100  s1 %= largest prime smaller than 65536
101  s2 %= largest prime smaller than 65536
103  Return s2 << 16 | s1
Caller
NameDescribe
zlib_inflatelate() uses a state machine to process as much input data and generate asmuch output data as possible before returning
read_buf