PHP Improve script speed

I am currently using a default PHP function called CRC32(). It can be found here "[url removed, login to view]". I'm using it to generate a unique integer that I use as a Primary ID in mysql. The generated ID is based on content from two fields on the same mysql row. I also add some other numbers to the front and end of the CRC code to make sure it is always unique.

It works great for what I want to do. How ever the problem is that I process over 28,000,000 million records a day. The crc32 function is to slow and my script doesn't finish in time. I need something that will always calculate to the same unique integer given the same content. The ID needs to be at least 9 to 10 characters long and has to be a integer (No Alpha or symbol characters in the ID). I count the string length and count the spaces in the string and add that to the end of the CRC ID to make it more unique to avoid collisions.

**I am going to be out of the country from November 14th till the 25th. So if I select you to do this bid. I need it complete by the 13th so I can close the bid and release payment. If it's not done by the 13th you will have to wait till the 25th when I get back to go over deliverable and release payment.**

I also found this function online which is quick but does not generate a large enough CRC.


function crc16($string,$crc=0) {

for ( $x=0; $x<strlen( $string ); $x++ ) {

$crc = $crc ^ ord( $string[$x] );

for ($y = 0; $y < 8; $y++) {

if ( ($crc & 0x0001) == 0x0001 ) $crc = ( ($crc >> 1 ) ^ 0xA001 );

else $crc = $crc >> 1;



return $crc;



Any ideas? I am open to different algorithms that may be faster. I am only using CRC32 because I don’t know of another method.

Habilidades: Engenharia, MySQL, PHP, Gestão de projetos, Arquitetura de software, Teste de Software, Hospedagem Web, Gestão de Site , Teste de Website

Veja mais: what is algorithms, two string problem, the string problem, string algorithms, speed net online, php manual, how to make algorithms, how to do algorithms, get length of string in c, different algorithms for the same problem can, different algorithms, deliverable management, php symbol, php end script, slow speed, php function , ord, need a quick mysql script, front en, crc-16, release management, manual 13th, alpha net, string integer, large script

Acerca do Empregador:
( 162 comentários ) Oakland Park, United States

ID do Projeto: #2958031

5 freelancers estão ofertando em média $40 para esse trabalho


See private message.

$11.05 USD in 14 dias
(30 Comentários)

See private message.

$8.5 USD in 14 dias
(85 Comentários)

See private message.

$5.95 USD in 14 dias
(40 Comentários)

See private message.

$170 USD in 14 dias
(6 Comentários)

See private message.

$3.4 USD in 14 dias
(6 Comentários)