| Title: | Example Package Using Exported 'crc32c' Functions |
|---|---|
| Description: | The 'crc32c' package exposes a C-level API allowing other packages to use the functions it exposed. This packages provides a simple example of how. (The 'zigg' package has more extended examples of using the function it exposes in four different ways.) |
| Authors: | Dirk Eddelbuettel [aut, cre] |
| Maintainer: | Dirk Eddelbuettel <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 0.0.1 |
| Built: | 2026-05-31 10:25:21 UTC |
| Source: | https://github.com/eddelbuettel/crc32c-example |
The 'crc32c' package exposes a C-level API allowing other packages to use the functions it exposed. This packages provides a simple example of how. (The 'zigg' package has more extended examples of using the function it exposes in four different ways.)
Index of help topics:
crc32cdemo Demo of calling 'crc32c' functions
crc32cExample-package Example Package Using Exported 'crc32c'
Functions
Dirk Eddelbuettel <[email protected]>
Dirk Eddelbuettel [aut, cre]
The 'crc32c' website has command-line demo showing how to call the library.
This function crc32cdemo exposes the same functionality, but relying on R package 'crc32c'
to provide the object code. The two other functions provide checksum calculation examples.
crc32cdemo() crc32c_string(s) crc32c_raw(x)crc32cdemo() crc32c_string(s) crc32c_raw(x)
s |
A string |
x |
A raw vector |
The function crc32cdemo is called for its side effect of printing to stdout,
and nothing is returned. The function crc32c_raw returns the checksum of a raw
input vector.
s <- "The quick brown fox" crc32c_string(s) r <- sin(seq(0, pi, by = 0.01)) rb <- writeBin(r, raw(), size = 8L) crc32c_raw(rb)s <- "The quick brown fox" crc32c_string(s) r <- sin(seq(0, pi, by = 0.01)) rb <- writeBin(r, raw(), size = 8L) crc32c_raw(rb)