Click here to Skip to main content
15,922,155 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: PNG's and GDI+ Pin
Randor 1-Sep-09 21:36
professional Randor 1-Sep-09 21:36 
GeneralRe: PNG's and GDI+ Pin
VCsamir3-Sep-09 0:58
VCsamir3-Sep-09 0:58 
QuestionMSI Migration --- issues Pin
ERLN31-Aug-09 22:04
ERLN31-Aug-09 22:04 
QuestionSCSI command release mode problem Pin
Abinash Mohanty31-Aug-09 20:30
Abinash Mohanty31-Aug-09 20:30 
AnswerRe: SCSI command release mode problem Pin
David Crow1-Sep-09 3:07
David Crow1-Sep-09 3:07 
AnswerRe: SCSI command release mode problem Pin
Randor 1-Sep-09 22:03
professional Randor 1-Sep-09 22:03 
AnswerRe: SCSI command release mode problem Pin
Glamar15-Sep-09 17:49
Glamar15-Sep-09 17:49 
GeneralRe: SCSI command release mode problem Pin
Glamar15-Sep-09 17:54
Glamar15-Sep-09 17:54 
Questionhow can i jump from the loop before i exit this program automatically? Pin
Member 3121931-Aug-09 20:00
Member 3121931-Aug-09 20:00 
AnswerRe: how can i jump from the loop before i exit this program automatically? Pin
Cedric Moonen31-Aug-09 20:23
Cedric Moonen31-Aug-09 20:23 
AnswerRe: how can i jump from the loop before i exit this program automatically? Pin
Cedric Moonen31-Aug-09 20:33
Cedric Moonen31-Aug-09 20:33 
AnswerRe: how can i jump from the loop before i exit this program automatically? Pin
Adam Roderick J31-Aug-09 20:49
Adam Roderick J31-Aug-09 20:49 
AnswerRe: how can i jump from the loop before i exit this program automatically? Pin
Iain Clarke, Warrior Programmer31-Aug-09 20:50
Iain Clarke, Warrior Programmer31-Aug-09 20:50 
GeneralRe: how can i jump from the loop before i exit this program automatically? Pin
Rajesh R Subramanian31-Aug-09 20:54
professionalRajesh R Subramanian31-Aug-09 20:54 
GeneralRe: how can i jump from the loop before i exit this program automatically? Pin
Adam Roderick J31-Aug-09 20:57
Adam Roderick J31-Aug-09 20:57 
GeneralRe: how can i jump from the loop before i exit this program automatically? Pin
Iain Clarke, Warrior Programmer31-Aug-09 21:00
Iain Clarke, Warrior Programmer31-Aug-09 21:00 
QuestionRe: how can i jump from the loop before i exit this program automatically? Pin
David Crow1-Sep-09 2:57
David Crow1-Sep-09 2:57 
AnswerRe: how can i jump from the loop before i exit this program automatically? Pin
Rajesh R Subramanian1-Sep-09 5:17
professionalRajesh R Subramanian1-Sep-09 5:17 
JokeRe: how can i jump from the loop before i exit this program automatically? Pin
Rajesh R Subramanian31-Aug-09 23:36
professionalRajesh R Subramanian31-Aug-09 23:36 
GeneralRe: how can i jump from the loop before i exit this program automatically? Pin
Iain Clarke, Warrior Programmer1-Sep-09 1:18
Iain Clarke, Warrior Programmer1-Sep-09 1:18 
AnswerRe: how can i jump from the loop before i exit this program automatically? Pin
Cedric Moonen1-Sep-09 3:59
Cedric Moonen1-Sep-09 3:59 
QuestionHash Look up Logic Pin
mohant$.net31-Aug-09 19:55
mohant$.net31-Aug-09 19:55 
AnswerRe: Hash Look up Logic Pin
Adam Roderick J31-Aug-09 20:09
Adam Roderick J31-Aug-09 20:09 
GeneralRe: Hash Look up Logic Pin
mohant$.net31-Aug-09 20:16
mohant$.net31-Aug-09 20:16 
GeneralRe: Hash Look up Logic [modified] Pin
Adam Roderick J31-Aug-09 20:31
Adam Roderick J31-Aug-09 20:31 
CRC is a non secured hashing function and it is widely used one.
For 5000 i think CRC 12 or CRC 13 as per ur need.

Just refer the below link

http://en.wikipedia.org/wiki/Cyclic_redundancy_check[^]

i am giving and example of for CRC 16 given below


const WORD CRC16BIT_TAB[8] =
{
0x0000, 0xCC01, 0xD801, 0x1400,
0xF001, 0x3C00, 0x2800, 0xE401,
};

unsigned int CRC16( const BYTE* pBuffer, const int nLength )
{
unsigned int ulCRCRet = 0;
unsigned int ulTempVal = 0;
int nIndex = 0;
for(nIndex = 0; nIndex < nLength; nIndex++, pBuffer++)
{
// lower 4 bits
ulTempVal = CRC16BIT_TAB[ulCRCRet & 0x000F];
ulCRCRet = (ulCRCRet >> 4) & 0x0FFF;
ulCRCRet = ulCRCRet ^ ulTempVal ^ CRC16BIT_TAB[*pBuffer & 0x000F];

// Upper 4 bits
ulTempVal = CRC16BIT_TAB[ulCRCRet & 0x000F];
ulCRCRet = (ulCRCRet >> 4) & 0x0FFF;
ulCRCRet = ulCRCRet ^ ulTempVal ^ CRC16BIT_TAB[(*pBuffer >> 4) & 0x000F];
}
return ulCRCRet;
}

int main(int argc, char* argv[])
{
BYTE data[] = { 'A', 'D', 'E', 'R', 'T', 'W', 'i', 'E', 'Y', 't' ,'h', 'e', 'm', 'r', 'T'};
unsigned short int ulCRCVal = 0;
ulCRCVal = CRC16(data, sizeof(data) / sizeof(data[0]));
std::cout << ulCRCVal << ::std::endl;
return 1;
}

Величие не Бога может быть недооценена.

modified on Tuesday, September 1, 2009 2:39 AM

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.