9.0
top
← prev up next →

crc32cπŸ”— i

Tetsumi <testumi@protonmail.com>

(require crc32c ) package: crc32c

This package provides an implementation of CRC32-C.

CRC32-C is specified as the CRC that uses the iSCSI polynomial (#x1edc6f41) in RFC 3720. The polynomial was introduced by G. Castagnoli, S. Braeuer and M. Herrmann.

1Basic GenerationπŸ”— i

procedure

( crc32c-bytes bytes)fixnum?

bytes:bytes?
Generates a checksum from a bytes? object.

Example:
> (crc32c-bytes #"Lorem ipsum dolor sit amet")

3993763883

procedure

( crc32c-string/utf8 string)fixnum?

string:string?
string:string?
string:string?
Generates a checksum from a string? object.

Example:
> (crc32c-string/utf8 "Lorem ipsum dolor sit amet")

3993763883

Generates a checksum reading bytes from an input-port? object.

Examples:
> (crc32c-input-port (open-input-bytes #"Lorem ipsum dolor sit amet"))

3993763883

> (crc32c-input-port (open-input-string "Lorem ipsum dolor sit amet"))

3993763883

2Incremental GenerationπŸ”— i

The following procedures generate a checksum incrementally, one byte at a time.

value

crc32c-initial-value :fixnum? =4294967295

Initial value to use to start the generation of a checksum.

procedure

( crc32c-update accbyte)fixnum?

acc:fixnum?
byte:byte?
Returns updated acc after using byte.

Example:

procedure

( crc32c-finalize acc)fixnum?

acc:fixnum?
Finalizes the generation by applying the final XOR operation to acc.

Examples:

3127684199

#:result(crc32c-finalize acc))
([ch"Lorem ipsum dolor sit amet"])

3993763883

top
← prev up next →

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /