LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-29-2004, 04:32 PM   #1
docbrazen
LQ Newbie
 
Registered: Nov 2003
Distribution: Slackware-current, Red Hat 9
Posts: 18

Rep: Reputation: 0
How do I generate a crc32 checksum?


Hi,

Does anyone know how I can generate a crc32 checksum for a file in linux? I tried using cksum, but I think that is something different. I would use md5sum but the person I got the file from doesn't haven access to that.

docbrazen
 
Old 03-29-2004, 05:05 PM   #2
Peacedog
Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,292

Rep: Reputation: 167Reputation: 167
i've never done this, but, here are a few leads.

http://freshmeat.net/projects/checkcrc/

http://www.dakotacom.net/~donut/programs/fchksum.html

hope that helps.
good luck.
 
Old 03-29-2004, 06:15 PM   #3
docbrazen
LQ Newbie
 
Registered: Nov 2003
Distribution: Slackware-current, Red Hat 9
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by PEACEDOG
i've never done this, but, here are a few leads.

http://freshmeat.net/projects/checkcrc/

http://www.dakotacom.net/~donut/programs/fchksum.html

hope that helps.
good luck.
Thanks for the response. I'll give those programs a try and tell you if it works out.
 
Old 03-29-2004, 06:25 PM   #4
Peacedog
Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,292

Rep: Reputation: 167Reputation: 167
like i said, i have 0 experience w/this. just thought a few leads may get you pointed in the right direction. hope it works out.
good luck.
 
Old 03-29-2004, 08:41 PM   #5
docbrazen
LQ Newbie
 
Registered: Nov 2003
Distribution: Slackware-current, Red Hat 9
Posts: 18

Original Poster
Rep: Reputation: 0
I didn't have access to python on one of the machines, but the second link worked like a charm. Thanks.


docbrazen
 
Old 12-09-2005, 10:43 PM   #6
Xandor
Member
 
Registered: Oct 2005
Distribution: Ubuntu 5.10
Posts: 31

Rep: Reputation: 15
file: md5sum [filename]
string: echo [string] | md5sum
 
Old 01-03-2011, 06:56 PM   #7
jetole
LQ Newbie
 
Registered: Feb 2008
Posts: 9

Rep: Reputation: 2
Quote:
Originally Posted by Xandor View Post
file: md5sum [filename]
string: echo [string] | md5sum
The op asked how to generate a crc32 checksum. While the lines you posted will produce a checksum, they will be using a MD5 hash instead of the CRC (Cyclic Redundancy Check) hash.

As far as I know, most distributions don't have a crc32 tool packaged with them as I was just looking for the same thing myself. Ubuntu (10.04) doesn't seem to have one in the repos either though it does have some perl libs for crc32 generation so if you know perl then you can whip one together. I think I am going to do this tonight myself.
 
Old 01-03-2011, 07:06 PM   #8
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 543Reputation: 543Reputation: 543Reputation: 543Reputation: 543Reputation: 543
Hi jetole,

thanks for adding some potentially helpful information to this thread.

I just wanted to point out though (a friendly FYI ) in case you didn't notice, this thread is very old, and the OP has not even logged in in 6 1/2 years; so while some folks may benefit from any info you add, it's quite possible that the OP will not.

Anyhow, cheers & have a great day!
 
Old 05-04-2012, 06:42 AM   #9
IamaHack
LQ Newbie
 
Registered: May 2012
Distribution: Currently doing embedded linux so.... Buildroot? ;-)
Posts: 8

Rep: Reputation: Disabled
Libz exports the crc32 function

I know this is an older post, but for those who end up here, the common library that is part of almost every distribution is libz.so which exports an implementation of the crc32:

ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
/*
Update a running CRC-32 with the bytes buf[0..len-1] and return the
updated CRC-32. If buf is Z_NULL, this function returns the required
initial value for the for the crc. Pre- and post-conditioning (one's
complement) is performed within this function so it shouldn't be done by the
application.

Usage example:

uLong crc = crc32(0L, Z_NULL, 0);

while (read_buffer(buffer, length) != EOF) {
crc = crc32(crc, buffer, length);
}
if (crc != original_crc) error();
*/
 
Old 10-24-2012, 03:52 PM   #10
striek
LQ Newbie
 
Registered: Oct 2003
Location: The Great White North
Distribution: Slack
Posts: 2

Rep: Reputation: 0
Yes I know, very old thread, but I came across this from a google search and then later solved the problem.

cksum will calculate a crc32 checksum, it should be available on any linux system.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't active Library routines CRC32 in fedora 4 smashhead Linux - Wireless Networking 0 08-07-2005 12:20 AM
How to generate a .so library with two .a libraries yakotey Programming 1 06-29-2005 05:22 AM
How to generate ps from texinfo abd_bela Debian 1 05-02-2005 06:58 PM
Generate kernel RPM andy18 Linux - General 1 07-08-2004 04:14 AM
How to generate an rpm from source? Fredy71 Linux - General 1 03-04-2004 08:27 AM


All times are GMT -5. The time now is 09:23 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration