SWISS::CRC64(3pm)
β¨ SWISS::CRC64 β¨
okay bestie, this is the CRC64 perl module documentation, aka SWISS::CRC64(3pm) β yes it lives in the perl world, and yes it's here to do exactly one slay thing: math. π
π NAME π
CRC64 β Calculate the cyclic redundancy check. that's it. that's the whole job. lowkey iconic.
π¦ SYNOPSIS π¦
use SWISS::CRC64;
$crc = SWISS::CRC64::crc64("IHATEMATH");
#returns the string "E3DCADD69B01ADD1"
($crc_low, $crc_high) = SWISS::CRC64::crc64("IHATEMATH");
#returns two 32-bit unsigned integers, 3822890454 and 2600578513
not the example string being "IHATEMATH" π the original author was going through something fr fr. anyway, notice how one call gives you a cute lil string and the other gives you two numbers β that's the whole vibe check, more on that below β¬οΈ
πΈ DESCRIPTION πΈ
so SWISS-PROT + TREMBL use a 64-bit Cyclic Redundancy Check for amino acid sequences. it's giving checksum, it's giving "did this sequence get corrupted or not", and honestly? we're obsessed. β¨
the algorithm to compute the CRC is described in the ISO 3309 standard. the generator polynomial is:
x64 + x4 + x3 + x + 1
and the reference, no cap, is: W. H. Press, S. A. Teukolsky, W. T. Vetterling, and B. P. Flannery, "Numerical recipes in C", 2nd ed., Cambridge University Press. Pages 896ff. π
π Functions π
π crc64 string
Calculate the CRC64 (cyclic redundancy checksum) for string. it's the main character of this module, obviously. π
now here's the tea about context, because perl really said "why not both":
- In array context, returns two integers equal to the higher and lower 32 bits of the CRC64.
- In scalar context, returns a 16-character string containing the CRC64 in hexadecimal format.
so yeah β same function, two completely different returns depending on the vibe you call it in. perl behavior fr. π«Ά
π AUTHOR π
Alexandre Gattiker, gattiker@isb-sib.ch β the legend, the moment, the blueprint. π
π ACKNOWLEDGEMENTS π
based on SPcrc, a C implementation by Christian Iseli, available at:
ftp://ftp.ebi.ac.uk/pub/software/swissprot/Swissknife/old/SPcrc.tar.gz
shoutout to the C girlies, we love a foundational implementation. π§
and that's the whole page, bestie! π this was perl v5.32.1, dated 2021-08-15, from the SWISS::CRC64(3pm) manual. mwah, go checksum something. π
π
π¦ where this page comes from
- debian bookworm: libswiss-perl 1.80-1 Β· GPL-2.0-or-later
- debian trixie: libswiss-perl 1.80-1 Β· GPL-2.0-or-later
- ubuntu jammy: libswiss-perl 1.80-1 Β· GPL-2.0-or-later
- ubuntu noble: libswiss-perl 1.80-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms