CHECKSUM and CHECKSUM_AGG: What’s the algorithm?
On SQL Server Forum, at this page, it’s stated: The built-in CHECKSUM function in SQL Server is built on a series of 4 bit left rotational xor operations. See this post for more explanation.
On SQL Server Forum, at this page, it’s stated: The built-in CHECKSUM function in SQL Server is built on a series of 4 bit left rotational xor operations. See this post for more explanation.
Here are some extension methods that compute a Luhn checkdigit, validate a number with a checkdigit, and add a checkdigit to a number. Tested in .NET 4.5. There are extension methods for strings, ints, int64s and IList. I got some ideas for this from rosettacode.org using System; using System.Collections.Generic; using System.Globalization; using System.Linq; public static … Read more
You cannot trust the client, period. If your standalone app can decrypt it, so will they. Either put the data on a server or don’t bother, as the number of people who actually crack it to enhance stats will be minuscule, and they should probably be rewarded for the effort anyway! Put a string in … Read more
It’s not too painful to use command-line tools to filter out MVID and date-time stamps from a text representation of the IL. Suppose file1.exe and file2.exe are built from the same sources: c:\temp> ildasm /all /text file1.exe | find /v “Time-date stamp:” | find /v “MVID” > file1.txt c:\temp> ildasm /all /text file2.exe | find … Read more
I would say that a checksum is necessarily a hashcode. However, not all hashcodes make good checksums. A checksum has a special purpose — it verifies or checks the integrity of data (some can go beyond that by allowing for error-correction). “Good” checksums are easy to compute, and can detect many types of data corruptions … Read more
The polynomial for CRC32 is: x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1 Wikipedia CRC calculation Or in hex and binary: 0x 01 04 C1 1D B7 1 0000 0100 1100 0001 0001 1101 … Read more
Update I added a helper function to create the CRCTable instead of having this enormous literal in the code. It could also be used to create the table once and save it in an object or variable and have the crc32 function use that (or as W3C’s example, check for the existence and create if … Read more
Something that should be noted here, and that most people overlook completely, is the fact, that the TCP checksum is actually a very poor checksum. The TCP checksum is a 16-bit ones-complement sum of the data. This sum will catch any burst error of 15 bits or less, and all 16-bit burst errors except for … Read more
Yes. You can see how in zlib‘s crc32_combine(). If you have two sequences A and B, then the pure CRC of AB is the exclusive-or of the CRC of A0 and the CRC of 0B, where the 0’s represent a series of zero bytes with the length of the corresponding sequence, i.e. B and A … Read more