Raised This Month: $51 Target: $400
 12% 

CRC-32 stocks


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 01-24-2013 , 15:54   CRC-32 stocks
Reply With Quote #1

Quote:
Originally Posted by Wikipedia
A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data.
CRC-32 is very fast, even on larger files, and it's designed to handle unintentional changes in data. Useful in cases such as verifying the integrity of a downloaded file.

It should not be used for security purposes.

PHP Code:
/**
 * Produces a CRC-32 checksum for a given data stream.
 *
 * @param data        Input data to calculate the checksum from.
 * @param size        Total size of data in bytes.
 * @return            CRC-32 checksum as an integer.
 */
stock CRC32_Data(const String:data[], size)

/**
 * Produces a CRC-32 checksum for a given file.
 *
 * @param path        Path to the file.
 * @return            CRC-32 checksum as an integer.
 * @error            Failed to open file or file does not exist.
 */
stock CRC32_File(const String:path[]) 
Attached Files
File Type: inc crc32.inc (4.4 KB, 236 views)
__________________

Last edited by GoD-Tony; 01-26-2013 at 03:27.
GoD-Tony is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 01-25-2013 , 11:11   Re: CRC-32 stocks
Reply With Quote #2

CRC-32 may be useful to tell if unintentional changes were made, but it has a much higher collision rate than newer methods such as MD5, SHA-1, and SHA-256/512 (aka SHA-2).
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 01-25-2013 at 11:13.
Powerlord is offline
Reply



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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:40.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode