summary refs log blame commit diff
path: root/doc/zlib/crc32.3
blob: a42df2afbd535f7e92ce14e76b50f866679fdf42 (plain) (tree)

































































                                                         
.Dd January 15, 2017
.Dt CRC32 3
.Os
.
.Sh NAME
.Nm crc32 ,
.Nm crc32_z
.Nd update CRC-32 checksum
.
.Sh LIBRARY
.Lb libz
.
.Sh SYNOPSIS
.In zlib.h
.Ft uLong
.Fn crc32 "uLong crc" "const Bytef *buf" "uInt len"
.Ft uLong
.Fn crc32_z "uLong crc" "const Bytef *buf" "z_size_t len"
.
.Sh DESCRIPTION
Update a running CRC-32 with the bytes
.Fa "buf[0..len-1]"
and return the updated CRC-32.
If
.Fa buf
is
.Dv Z_NULL ,
this function returns
the required initial value for the CRC.
Pre- and post-conditioning
(one's complement)
is performed within this function
so it shouldn't be done
by the application.
.
.Pp
.Fn crc32_z
is the same as
.Fn crc32 ,
but with a
.Vt size_t
length.
.
.Sh EXAMPLES
.Bd -literal -offset indent
uLong crc = crc32(0L, Z_NULL, 0);

while (read_buffer(buffer, length) != EOF) {
	crc = crc32(crc, buffer, length);
}
if (crc != original_crc) error();
.Ed
.
.Sh SEE ALSO
.Xr adler32 3 ,
.Xr crc32_combine 3
.
.Sh HISTORY
This manual page was converted from
.In zlib.h
to mdoc format by
.An June McEnroe Aq Mt june@causal.agency .
.
.Sh AUTHORS
.An Jean-loup Gailly Aq Mt jloup@gzip.org
.An Mark Adler Aq Mt madler@alumni.caltech.edu
00:06:09 -0400'>2019-07-01 | * Clean up 1sh prompt settingJune McEnroe2019-06-29 | * Rename catsh to 1shJune McEnroe2019-06-28 | | | | | Yes it's another rename because I felt like catsh was too long. 1sh is short and unique. * Set HISTSIZE in catshJune McEnroe2019-06-28 | * Set LESS=FRXJune McEnroe2019-06-19 | | | | | | This is how git invokes less by default. I think I want this everywhere. This allows color, exits if the input fits on one screen, and doesn't clear the screen. * Alias date=ddateJune McEnroe2019-06-16 | | | | Will I regret this? * Clean up catsh configJune McEnroe2019-04-18 | * Rename cash config to catshJune McEnroe2019-04-18 | * Color python imports as StatementJune McEnroe2019-04-15 | * Move /opt/pkg after /usr in PATHJune McEnroe2019-02-20 | | | | | Installing mandoc from pkgsrc also installs a man executable which is horribly broken. Keep using the system man. * Set man_hard_wrap in nvimJune McEnroe2019-02-20 | | | | | Vendoring man.vim until <https://github.com/neovim/neovim/pull/9633> is merged and appears in a release. * Color format specifiers light cyan in vimJune McEnroe2019-02-15 | * Add nmap gpJune McEnroe2019-02-15 | * Unify *up scripts into one up.shJune McEnroe2019-02-12 | * Use italic for underline in nvim man modeJune McEnroe2019-02-10 | | | | | This doesn't yet work in Terminal.app: <https://github.com/neovim/neovim/issues/9598>. * Set git commit.verboseJune McEnroe2019-02-10 | * Add hupJune McEnroe2019-02-09 | * Don't open folds when using {}June McEnroe2019-02-08 | * Import autoload/man.vim from 71bb4fdJune McEnroe2019-02-07 | | | | | | | | This is the version of man.vim prior to <https://github.com/neovim/neovim/pull/9023>. I opened an issue for the degraded experience <https://github.com/neovim/neovim/issues/9583>. * Set nvim Directory back to blueJune McEnroe2019-02-01 | | | | | nvim is going bad I tell ya. Man mode seems broken in the new version too. * Add def scriptJune McEnroe2019-02-01 | * Add back tux to ssh configJune McEnroe2019-01-26 | * Set nvim UI colors back to the 8-color paletteJune McEnroe2019-01-25 | | | | | Neovim seems intent on replacing all the default colors with ghastly choices from the 256-color palette. * Add !! alias in cashJune McEnroe2019-01-15 | * Use \$ in cash PS1 and add # to RPS1June McEnroe2019-01-15 | * Show full path in RPS1June McEnroe2019-01-13 | * Set PS0 in cashJune McEnroe2019-01-13 | * Change default ENV from cashrc to env.shJune McEnroe2019-01-13 | * Use colours in cash promptsJune McEnroe2019-01-13 | * Add cashrcJune McEnroe2019-01-11 | * Remove character NETHACKOPTIONSJune McEnroe2019-01-04 | * Run ls if gs failsJune McEnroe2018-12-31 | * Simplify htop displayJune McEnroe2018-12-29 | * Remove \h bindingJune McEnroe2018-12-02 | * Switch to pkgsrc on DarwinJune McEnroe2018-11-27 | | | | | | | | | I've had enough of Homebrew. I want a real package manager that can remove unneeded dependencies. neovim still isn't in pkgsrc, so download binaries of that separately for now. Hopefully I haven't broken any other systems by rewriting install.sh like this. * Set default .asm, .h, .sh syntax modes for vimJune McEnroe2018-11-23 |