source: project/wiki/eggref/5/crc @ 39501

Last change on this file since 39501 was 39501, checked in by Alaric Snell-Pym, 5 months ago

crc: Updated docs for C5

File size: 2.2 KB
Line 
1[[tags: egg]]
2
3== crc
4
5Computes CRC checksum
6
7[[toc:]]
8
9
10== Documentation
11
12Computes CRC (Cyclic Redundancy Check) Checksum.
13
14=== crc32
15
16<procedure>(crc32 STRING [LENGTH]) => integer</procedure>
17
18Returns the 32-bit checksum of the {{STRING}}. {{LENGTH}} is {{(string-length
19STRING)}} when missing.
20
21{{STRING}} may also be a {{blob}}.
22
23
24== Usage
25
26<enscript language=scheme>
27(import crc)
28</enscript>
29
30
31== Examples
32
33<enscript language=scheme>
34(import crc)
35
36(crc32 "abc") ;=> 891568578
37</enscript>
38
39
40== Notes
41
42* CRC32 checksum is 32-bit, and does not fit in a fixnum.
43
44* CRC16 is not available.
45
46
47== Author
48
49[[Daishi Kato]]
50
51
52== Version history
53
54; 1.0.2 : Adopt the recommended setup-helper usage.
55; 1.0.0 : From the Chicken 3 version. [[kon lovett]]
56
57
58== License
59
60Copyright (c) 2005, Daishi Kato
61All rights reserved.
62
63Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
64conditions are met:
65
66  Redistributions of source code must retain the above copyright notice, this list of conditions and the following
67    disclaimer.
68  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
69    disclaimer in the documentation and/or other materials provided with the distribution.
70  Neither the name of the author nor the names of its contributors may be used to endorse or promote
71    products derived from this software without specific prior written permission.
72
73THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
74OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
75AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
76CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
77CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
78SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
79THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
80OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
81POSSIBILITY OF SUCH DAMAGE.
Note: See TracBrowser for help on using the repository browser.