Free Access Week-  Data Engineering + BI
Data engineering and BI courses are free!
Free AI Access Week from June 2-8

bitops (version 1.0-4.2)

cksum: Compute Check Sum

Description

return a cyclic redundancy checksum for each element in the argument.

Usage

cksum(a)

Arguments

a
coerced to character vector

Value

  • numeric vector of length a.

Details

NA's appearing in the argument are returned as NA's.

The default calculation is identical to that given in pseudo-code in the ACM article (in the References).

References

Fashioned from cksum(1) UNIX command line utility, i.e., man cksum.

Dilip V. Sarwate (1988). Computation of Cyclic Redundancy Checks Via Table Lookup, Communications of the ACM, August 1988. vol 31, No.8 page 1008-1013

Examples

Run this code
b <- "I would rather have a bottle in front of me than frontal lobotomy
"
   cksum(b) == 1342168430 ## -> TRUE

Run the code above in your browser using DataLab