Click here to Skip to main content
15,899,754 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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

AnswerRe: Hash Look up Logic Pin
Stuart Dootson31-Aug-09 23:04
professionalStuart Dootson31-Aug-09 23:04 
GeneralRe: Hash Look up Logic Pin
mohant$.net31-Aug-09 23:19
mohant$.net31-Aug-09 23:19 
GeneralRe: Hash Look up Logic Pin
Stuart Dootson31-Aug-09 23:22
professionalStuart Dootson31-Aug-09 23:22 
AnswerRe: Hash Look up Logic Pin
Alan Balkany1-Sep-09 5:32
Alan Balkany1-Sep-09 5:32 
Questionset dialog transparence but control not Pin
zhanghui543231-Aug-09 19:54
zhanghui543231-Aug-09 19:54 
QuestionOutlook Automation Pin
john563231-Aug-09 19:47
john563231-Aug-09 19:47 
AnswerRe: Outlook Automation Pin
Stuart Dootson31-Aug-09 23:13
professionalStuart Dootson31-Aug-09 23:13 
QuestionCan i send Array in command line parameter of CeCreateProcess? Pin
Le@rner31-Aug-09 19:19
Le@rner31-Aug-09 19:19 
AnswerNews: Nothing has changed today! Pin
Rajesh R Subramanian31-Aug-09 19:51
professionalRajesh R Subramanian31-Aug-09 19:51 
AnswerRe: Can i send Array in command line parameter of CeCreateProcess? Pin
Adam Roderick J31-Aug-09 19:58
Adam Roderick J31-Aug-09 19:58 
QuestionCFrameWnd and CToolBar and tooltips. Should be simple but.. [modified] Pin
FloatingMarc31-Aug-09 17:31
FloatingMarc31-Aug-09 17:31 
QuestionSetLayeredWindowAttributes , set a dialog . Pin
zhanghui543231-Aug-09 16:15
zhanghui543231-Aug-09 16:15 
AnswerRe: SetLayeredWindowAttributes , set a dialog . Pin
«_Superman_»31-Aug-09 17:56
professional«_Superman_»31-Aug-09 17:56 
Questionfrom Font Name and Font Size ==&gt; TextWidth and Textheight ?? Pin
aa_zz31-Aug-09 15:29
aa_zz31-Aug-09 15:29 
AnswerRe: from Font Name and Font Size ==&gt; TextWidth and Textheight ?? Pin
«_Superman_»31-Aug-09 18:03
professional«_Superman_»31-Aug-09 18:03 
QuestionQuestion about RichEdit: the style of underline Pin
xp52431-Aug-09 3:45
xp52431-Aug-09 3:45 
AnswerRe: Question about RichEdit: the style of underline Pin
xp5241-Sep-09 15:45
xp5241-Sep-09 15:45 

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.