Score:0

Forming a 64 bit CRC from a 32 bit CRC

us flag

Suppose I have a 32 bit CRC function $\text{crc32}(x)$ that satisfies all the properties of a CRC. Suppose also that I am a lazy developer who wants to create a 64 bit CRC function but doesn't want to actually have to implement another CRC, so I design a function

$$ f(x)= \text{crc32}( {\tt{"}\tt{foo}\tt{"}}\ ||\ x ) \cdot 2^{32} + \text{crc32}( {\tt{"}\tt{bar}\tt{"}}\ ||\ x ) $$ Does $f$ form a CRC?

hft avatar
ng flag
hft
Regarding "all the properties of a CRC," you linked to a wikipedia page that is not a list of "all the properties of a CRC" but rather is a long page with explanations of what a CRC is... but various explanations are not consistent in their properties. Can you list all the desired properties rather than providing a link to a long web page that would have to be parsed and interpreted by us? Anyways, it you just want a hash that is 64-bit they you have constructed one. But if you actually want to do error correction, I'm not sure. What do you want to do?
Score:2
my flag

Your $f$ is exactly equivalent to this:

$$f(x) = (\text{crc32}(x) \oplus C_1)\ || \ (\text{crc32}(x) \oplus C_2)$$

For appropriate $C_1, C_2$ values that depend on the length of $X$; $C_1 = \text{crc32}(\text{"foo"} || 0^{\text{len}(X)}) \oplus \text{crc32}(0^{\text{len}(X)})$, and $C_2 = \text{crc32}(\text{"bar"} || 0^{\text{len}(X)}) \oplus \text{crc32}(0^{\text{len}(X)})$

That is, it is effectively the crc32 of $x$ twice, except that certain bits of the first and second copy are flipped; which bits depend on the length of $x$, but nothing else.

This means that the error detection properties of your function are effectively that of crc32, and nothing better.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.