checksum

Is there any metadata associated with word document?

Hi, I am trying to generate check sum of a word document by opening at binary level. I generate the check sum of the document. Copy the document to a different location. When I generate the checksum at the new location I get a different value though I haven't changed the contents of the document. The check sum varies even if I copy the ...

Calculate Hash or Checksum for a table in SQL Server

I'm trying to compute a checksum or a hash for an entire table in SQL Server 2008. The problem I'm running into is that the table contains an XML column datatype, which cannot be used by checksum and has to be converted to nvarchar first. So I need to break it down into two problems: calculate a checksum for a row, schema is unknown be...

Bit shifting in internet checksums.

This is almost certainly a very silly question, but for some reason I'm having trouble with internet checksum calculations. All of the algorithms basically look something like this: WORD chksm(WORD *startpos, WORD checklen){ ulong sum = 0; WORD answer = 0; while (checklen > 1) { sum += *startpos++; checklen -= 2; } if (checklen == ...

Checking for Duplicate Files without Storing their Checksums

For instance, you have an application which processes files that are sent by different clients. The clients send tons of files everyday and you load the content of those files into your system. The files have the same format. The only constraint that you are given is you are not allowed to run the same file twice. In order to check if ...

Tips on building a byte protocol

I'm communicating data between devices, and I have to program the protocol as an array of bytes. Any tips when building protocols at a low-level? .. Eg: Use a 2 byte header, to send the length of the message before the data bytes. Use a CRC/data validation scheme. (How do I do this? Any simple checksums?) ...

checksum udp calculation python

Hi, I'd like to calculate the checksum of an udp header packet I want to send : packetosend = """60 00 00 00 00 24 3a 40 20 02 c0 a8 01 50 00 01 00 00 00 00 00 00 09 38 20 02 c0 a8 01 50 00 01 00 00 00 00 00 00 09 6f""" so i need to join this utf-16 (not a problem) and calculate the checksum of this specific packet. How can i do that ...

How can I sum large hexadecimal values in Perl?

I'm iterating over a set of 32-bit hexadecimal strings ("DEADBEEF", "12345678", etc..) and I'm trying to sum them together to form a 32-bit checksum. Assume that the variable $temp is loaded with some hexadecimal string in the example below. my $temp; my $checksum; for (...) { #assume $temp is loaded with a new hex string here ...

Compiling Twice with Delphi 6 and getting the same checksum on the binary

For the purposes of binary / source code verification, i'd like to be able to make two compiles on the same computer 2 weeks apart and have the binaries be identical and thus pass some checksum test. So far I've found that most likely the timestamp will be written by the compiler into the binary. I can work around this by doing the com...

CRC-4 implementation in C#

Hi. I've been searching the net for a C# implementation of the 4-bit cyclic redundancy check (CRC-4-ITU) but so far I've been unsuccessful. Is there anyone who's able to give me a reference implementation of CRC-4-ITU? Preferrably with the standard polynomial if there is a standard polynomial (I've read the spec pointed to by wikipedia...

How do I check if a string is a valid md5 or sha1 checksum string

I don't want to calculate a file's checksum, just to know if a given string is a valid checksum ...

User-friendly checksum validation on Mac OS?

I'm not entirely sure if this a SO or SF question, but I'll give it a go here. We're offering DMGs for download and a MD5 checksum to go with each. The question is how to instruct users of how to actually checksum and compare with the given checksum. Users aren't going to be all that tech savvy. One idea was to produce a copy-paste bas...

Reading MP3 audio data, or calculating the checksum thereof

Is there a Ruby library that will allow me to either calculate the checksum of an MP3 file's audio data (minus the metadata) or allow me to read in an MP3's audio data to calculate the checksum myself? I'm looking for something like this: mp3 = Mp3Lib::MP3.new('/path/to/song.mp3') mp3.audio.sha1sum # => the sha1 checksum of _only_ th...

A quick string checksum function in Perl generating values in the 0..2^32-1 range

I'm looking for a Perl string checksum function with the following properties: Input: Unicode string of undefined length ($string) Output: Unsigned integer ($hash), for which 0 <= $hash <= 2^32-1 holds (0 to 4294967295, matching the size of a 4-byte MySQL unsigned int) Pseudo-code: sub checksum { my $string = shift; my $hash...

C to Java port: calculating a 3 byte checksum

Does this seem correct? I'm trying to port this checksum method from C to Java but the values returned from my Java function are too high. I suspect the way I'm fudging the unsigned int is not correct? char *Generate( char * buffer, long length ) { static char tBuf[4]; long index; unsigned int checksum; for( index ...

Checksum JPEG data (not the whole file)

Are there end-of-exif / end-of-xmp / end-of-iptc / start-of-data markers that I could use to get a checksum of just the data part of a jpg / jpeg (and other image formats)? ...

What algorithm should be used when doing filechecksums to find dupes?

Is taking a MD5 sum still suitable for checking for file dupes? I know that it isn't secure, but does that really matter in the case of trying to find file dupes? Should I be using something in the SHA family instead? What is best practice in this use case? ...

How do I do a SHA1 File Checksum in C#?

How do I use the SHA1CryptoServiceProvider() on a file to create a SHA1 Checksum of the file? ...

download large files from a remote server, how to test for correct file and delivery?

There are 2 servers that are geographically very far from each other. One server does file processing, then saves the processed file in a directory: c:\processed\ Files can be 100-1GB in size. The 2nd server is to download these files. What techniques can I use to check if the file correctly downloaded? Is a checksum all I need to ...

Compute Arithmetic Sum to Communicate with Machine Over Serial

I am communicating with a machine over serial. Part of the protocol communication spec states that the control sum is an "arithmetic sum of bytes from <'PS'> (included), <'data'> to <'CS'>" The packet messages are structured as follows: <'PS'><'data'><'CS'>, where: <'PS'> - Packet Size Length: 1 Value: 0x02 to 0x63 Max packet leng...

Why do some sites have a md5 string on each file?

On some sites, in their download section each file has a md5. md5 of what? i cant understand the purpose on phpBB.com for example: Download phpBB 3.0.6 (zip) Size: 2.30 MiB MD5: 63e2bde5bd03d8ed504fe181a70ec97a ...