Boa tarde,

Pessoal, preciso desta função em C, convertida em AS3. Já fiz várias
tentativas e o output nunca é o esperado!

unsigned short crc_calculate_crc (unsigned short initial_crc, const
unsigned char *buffer, unsigned short length)

{

unsigned short index = 0;

unsigned short crc = initial_crc;

if (buffer != NULL)

{

for (index = 0; index < length; index++)

{

crc = (unsigned short)((unsigned char)(crc >> 8) | (unsigned short)(crc <<
8));

crc ^= buffer [index];

crc ^= (unsigned char)(crc & 0xff) >> 4;

crc ^= (unsigned short)((unsigned short)(crc << 8) << 4);

crc ^= (unsigned short)((unsigned short)((crc & 0xff) << 4) << 1);

}

}

return (crc);

}

-- 
Recebeu esta mensagem porque está inscrito no grupo "Mailing List da Comunidade 
Portuguesa de Rich Internet Applications - www.riapt.org" dos Grupos do Google.

Para anular a subscrição deste grupo e parar de receber emails do mesmo, envie 
um email para [email protected].
Para publicar uma mensagem neste grupo, envie um e-mail para 
[email protected].
Visite este grupo em http://groups.google.com/group/riapt.
Para mais opções, consulte https://groups.google.com/d/optout.

Responder a