checksum

What algorithm to use to calculate a check digit?

What algorithm to use to calculate a check digit for a list of digits? The length of the list is between 8 and 12 digits. see also: How to generate a verification code/number? ...

File containing its own checksum

Is it possible to create a file that will contain its own checksum (MD5, SHA1, whatever)? And to upset jokers I mean checksum in plain, not function calculating it. ...

Checksum for multipage tiff document

I want to calculate the checksum for a large tiff file that might not fit in memory. Will I get a reliable value if I instead calculate the checksum of every page and then calculate the checksum of the array of page checksums or will I run into a mathematical problem that I am not seeing and the only correct way to do it is to in fact wo...

EAN 8 : How to calculate checksum digit ?

I need to create EAN 8 bar code programmatically. I search an algorithm to calculate the checksum digit. ...

Incremental Checksums

I am looking for a checksum algorithm where for a large block of data the checksum is equal to the sum of checksums from all the smaller component blocks. Most of what I have found is from RFCs 1624/1141 which do provide this functionality. Does anyone have any experience with these checksumming techniques or a similar one? ...

What is the fastest way to create a checksum for large files in C#

Hi, I have to sync large files across some machines. The files can be up to 6GB in size. The sync will be done manually every few weeks. I cant take the filename into consideration because they can change anytime. My plan is to create checksums on the destination PC and on the source PC and than copy all files with a checksum, which ar...

Best way to generate order numbers for an online store?

Every order in my online store has a user-facing order number. I'm wondering the best way to generate them. Criteria include: Short Easy to say over the phone (e.g., "m" and "n" are ambiguous) Unique Checksum (overkill? Useful?) Edit: Doesn't reveal how many total orders there have been (a customer might find it unnerving to make your ...

Should I use CRC-16 or IP checksum (RFC1071) for an embedded application?

I'm writing an embedded application on an ARM7 processor and I need some form of checksum for data that I'm sending over a serial link as well for data that I'm storing in the flash. I was wondering which of the two CRCs would be better suited for the purpose. The main trade-off are code speed versus robustness. Should I consider anoth...

SQL table self-reference query vs. unique constraints using checksum

I would like to better understand the differences for checking uniqueness in a record before an INSERT between using CHECKSUM (with unique constraints) versus self-referencing table statement like the one below. What scenarios would pose one option to be the best choice over the other, and for what reasons? Requirement: Each set of colu...

enough using checksum

How would you do that? You are sending files which contains many lines.Every line is a record from database. All files are zipped toggether into one file. Is it enough to send a checksum with this file to ensure that other side received all records and none has disappear? ...

Error Detection Effiency (CRC, Checksum, etc)

I have a hypothetical situation of sending data units, each of a thousand bytes. Failure rate is rare but when a error does occur it is less likely to be a single bit error and more likely to be an error in a few bits in a row. At first I thought of using a checksum, but apparently that can miss bit errors larger than a single bit. A pa...

How can I tell if two image files are the same in Perl?

I have a Perl script I wrote for my own personal use that fetches image files from a website periodically. It then saves these images to a folder. These image files are quite often the same from fetch to fetch, and I'd like to not save duplicates if I can get around it. My question: What would be the best way to compare/check if they ...

How to compare 2 files fast using .NET?

Typical approaches recommend reading the binary via FileStream and comparing it byte-by-byte. Would a checksum comparison such as CRC be faster? Are there any .NET libraries that can generate a checksum for a file? ...

Image file cheksum as a unique content compare optimalisation

Users are uploading fotos to our php build system. Some of them we are marking as forbidden because of not relevant content. I´m searching for optimalisation of an 'AUTO-COMPARE' algorithm which is skipping these marked as forbidden fotos. Every upload need to be compared to many vorbinden. Possible solutions: 1/ Store forbidden files ...

Still need checksum in application protocol when tcp/ip already has it?

I am designing an application protocol, and i am wondering if i still need include checksum in the protocol since tcp/ip already has checksum. what's your opinion? ...

Generating Luhn Checksums

There are lots of implementations for validating Luhn checksums but very few for generating them. I've come across this one however in my tests it has revealed to be buggy and I don't understand the logic behind the delta variable. I've made this function that supposedly should generated Luhn checksums but for some reason that I haven't...

Reproducable MD5/SHA1 on a rebuild of C# .exe

Hi, I'll give you a little bit of background first as to why I'm asking this question: I am currently working in a stricly-regulated industry and as such our code is quite carefully looked-over by official test houses. These test houses expect to be able to build the code and generate an .exe or .dll which is EXACTLY the same each and e...

UDP checksum calculation

Hi, The UDP header struct defined at /usr/include/netinet/udp.h is as follows struct udphdr { u_int16_t source; u_int16_t dest; u_int16_t len; u_int16_t check; }; What value is stored in the check field of the header? How to verify if the checksum is correct? I meant on what data is the checksum computed? (Is it just the udp ...

How do I calculate a REBOL 3 module checksum?

It's possible in REBOL 3 to calculate a SHA1 module checksum. When REBOL loads a module, it compares its checksum against the checksum of the loaded module, and if the two do not match, an error is generated, viz. access error: invalid checksum (tampered file). No matter how I try, I can't seem to create a module checksum that REBOL 3 l...

Why is the calculated checksum not matching the BCC sent over the serial port?

I've got a little application written in C# that listens on a SerialPort for information to come in. The information comes in as: STX + data + ETX + BCC. We then calculate the BCC of the transmission packet and compare. The function is: private bool ConsistencyCheck(byte[] buffer) { byte expected = buffer[buffer.Length - 1]; ...