Geeks With Blogs
Rishi Pande Me, Myself and my obsessions February 2006 Entries
blog story
Here is an interesting post this morning from the New York Metro. IT talks about why people blog and how some blogs are more popular than others (like me :( )
Have Fun!

Posted On Tuesday, February 14, 2006 7:43 AM

byte array to hex string in C++
Here is a way to convert your byte array to a hex string in c++. It will convert a byte array that looks like
2A 1F 2C
to a string value "2A1F2C"
char finalhash[20];
char hexval[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
for(int j = 0; j < 10; j++){
finalhash[j*2] = hexval[((hval[j] >> 4) & 0xF)];
finalhash[(j*2) + 1] = hexval[(hval[j]) & 0x0F];
}

Posted On Thursday, February 9, 2006 4:29 PM

Copyright © Rishi Pande | Powered by: GeeksWithBlogs.net