Looking for a good CRC algorithm. 
Author Message
 Looking for a good CRC algorithm.

And I don't have any in my books.  Anyone have a good fast one?  Please mail

often.  Would also like to se a CRC good argument for why a certain
algorithm is better than any other.

Thanks



Tue, 22 Aug 2000 03:00:00 GMT  
 Looking for a good CRC algorithm.


Quote:

> And I don't have any in my books.  Anyone have a good fast one?  Please mail

> often.  Would also like to se a CRC good argument for why a certain
> algorithm is better than any other.

> Thanks

A fine description of CRC algorithms is in
ftp://ftp.rocksoft.com/clients/rocksoft/papers/crc_v3.txt


Wed, 23 Aug 2000 03:00:00 GMT  
 Looking for a good CRC algorithm.

While trying to compile a .c file, I got a lot of errors.
I got a good deal of repeat errors, but they all went like so:

undefined reference to `number_range'
undefined reference to `bug'
undefined reference to `number_percent'

These errors filled my screen for a good 10 - 15 seconds, I didn't include
all the errors, because that would take too long.  I will, however, include
the portion of code that the first two errors came from.  (sorry for the
length of the code)

void send_obj_page_to_char(CHAR_DATA * ch, OBJ_INDEX_DATA * idx, char page);
void send_room_page_to_char(CHAR_DATA * ch, ROOM_INDEX_DATA * idx, char
page);
void send_page_to_char(CHAR_DATA * ch, MOB_INDEX_DATA * idx, char page);
void send_control_page_to_char(CHAR_DATA * ch, char page);
/*
 * Local functions.
 */
void talk_channel args( ( CHAR_DATA *ch, char *argument,
       int channel, const char *verb ) );
char *  scramble        args( ( const char *argument, int modifier ) );
char *  drunk_speech    args( ( const char *argument, CHAR_DATA *ch ) );
/* Text scrambler -- Altrag */
char *scramble( const char *argument, int modifier )
{
    static char arg[MAX_INPUT_LENGTH];
    sh_int position;
    sh_int conversion = 0;

 modifier %= number_range( 80, 300 ); /* Bitvectors get way too large #s */
    for ( position = 0; position < MAX_INPUT_LENGTH; position++ )
    {
     if ( argument[position] == '\0' )
     {
      arg[position] = '\0';
      return arg;
     }
     else if ( argument[position] >= 'A' && argument[position] <= 'Z' )
     {
      conversion = -conversion + position - modifier + argument[position] -
'A';
      conversion = number_range( conversion - 5, conversion + 5 );
      while ( conversion > 25 )
       conversion -= 26;
      while ( conversion < 0 )
       conversion += 26;
      arg[position] = conversion + 'A';
     }
     else if ( argument[position] >= 'a' && argument[position] <= 'z' )
     {
      conversion = -conversion + position - modifier + argument[position] -
'a';
      conversion = number_range( conversion - 5, conversion + 5 );
      while ( conversion > 25 )
       conversion -= 26;
      while ( conversion < 0 )
       conversion += 26;
      arg[position] = conversion + 'a';
     }
     else if ( argument[position] >= '0' && argument[position] <= '9' )
     {
      conversion = -conversion + position - modifier + argument[position] -
'0';
      conversion = number_range( conversion - 2, conversion + 2 );
      while ( conversion > 9 )
       conversion -= 10;
      while ( conversion < 0 )
       conversion += 10;
      arg[position] = conversion + '0';
     }
     else
      arg[position] = argument[position];
 }
 arg[position] = '\0';
 return arg;

Quote:
}

Can anyone help me fix the problem with this?  What it ends up being is a
big list of reference errors for every   variable with a "_" in it.

Thank you for the help



Wed, 23 Aug 2000 03:00:00 GMT  
 Looking for a good CRC algorithm.

Quote:

> While trying to compile a .c file, I got a lot of errors.
> I got a good deal of repeat errors, but they all went like so:

> undefined reference to `number_range'
> undefined reference to `bug'
> undefined reference to `number_percent'

:
:

Quote:
> Can anyone help me fix the problem with this?  What it ends up being is a
> big list of reference errors for every   variable with a "_" in it.

        The presence of an undefined reference to 'bug' contradicts your
last statement.  Further, in the sample you provided, number_range is
clearly used as a function, and not a variable.

        The linker is having trouble resolving references to these functions.
Make sure you have included all header files necessary at the top of the
source file you are having problems with, and that you have successfully
compiled those other source modules which define the number_range, etc.
functions (all modules that this source file depends upon must be compiled
first).  If these functions are being imported from third-party libraries,
make sure the libraries are in your directory path (and project, if working
from an IDE).

                                                        -- Stone



Wed, 23 Aug 2000 03:00:00 GMT  
 Looking for a good CRC algorithm.


Quote:
>And I don't have any in my books.  Anyone have a good fast one?  Please mail

>often.  Would also like to se a CRC good argument for why a certain
>algorithm is better than any other.

http://www.snippets.org - there are several CRC source files in C
and C++, as well as some tutorials.

Hope this helps.
--
Scott



Sun, 27 Aug 2000 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Looking for a CRC-32 algorithm implemented in C

2. Looking for references to 32-bit CRC algorithm

3. Looking for a good quick sort algorithm

4. Looking for good hashing algorithm in C/C++

5. Looking for a good real-time allocation algorithm in shared memory

6. looking for good internior FILL algorithm

7. CRC checking algorithm

8. Algorithm for CRC-8

9. CRC algorithms

10. CRC algorithm with lookup table

11. CRC algorithm

12. CRC-32 as hash algorithm?

 

 
Powered by phpBB® Forum Software