Click here to Skip to main content
15,909,742 members
Home / Discussions / C#
   

C#

 
GeneralClickety Pin
Colin Angus Mackay22-Aug-04 22:41
Colin Angus Mackay22-Aug-04 22:41 
GeneralRe: Clickety Pin
David Salter22-Aug-04 23:30
David Salter22-Aug-04 23:30 
GeneralBest way to calculate hash Pin
Radoslav Bielik22-Aug-04 21:28
Radoslav Bielik22-Aug-04 21:28 
GeneralRe: Best way to calculate hash Pin
Jonathan de Halleux22-Aug-04 23:19
Jonathan de Halleux22-Aug-04 23:19 
GeneralRe: Best way to calculate hash Pin
Radoslav Bielik22-Aug-04 23:37
Radoslav Bielik22-Aug-04 23:37 
GeneralRe: Best way to calculate hash Pin
Jonathan de Halleux22-Aug-04 23:48
Jonathan de Halleux22-Aug-04 23:48 
GeneralRe: Best way to calculate hash Pin
Radoslav Bielik23-Aug-04 0:01
Radoslav Bielik23-Aug-04 0:01 
GeneralRe: Best way to calculate hash Pin
Heath Stewart23-Aug-04 6:22
protectorHeath Stewart23-Aug-04 6:22 
Just enumerate the byte[] array and use ToString("x2") on each byte - appending the value - to have a valid hexidecimal representation. Make sure you include the "2", though, otherwise your hex string may not be a multiple of 2 (so any value less than 128 would not have the first "0"):
byte[] buffer = Encoding.Default.GetBytes("Hello, world!");
StringBuilder sb = new StringBuilder(buffer.Length * 2); // Initial capacity
foreach (byte b in buffer)
  sb.Append(b.ToString("x2")); // Faster than using StringBuilder.AppendFormat
return sb.ToString();


 

Software Design Engineer
Developer Division Sustained Engineering, Microsoft
My Articles
GeneralRe: Best way to calculate hash Pin
Radoslav Bielik23-Aug-04 8:48
Radoslav Bielik23-Aug-04 8:48 
GeneralRe: Best way to calculate hash Pin
Heath Stewart23-Aug-04 6:30
protectorHeath Stewart23-Aug-04 6:30 
GeneralRe: Best way to calculate hash Pin
Radoslav Bielik23-Aug-04 8:53
Radoslav Bielik23-Aug-04 8:53 
GeneralSorting an Arraylist Pin
malik1022-Aug-04 19:59
malik1022-Aug-04 19:59 
GeneralRe: Sorting an Arraylist Pin
sreejith ss nair22-Aug-04 20:11
sreejith ss nair22-Aug-04 20:11 
Generalproblem implementing special gradient Pin
obby22-Aug-04 19:52
obby22-Aug-04 19:52 
GeneralRe: problem implementing special gradient Pin
leppie22-Aug-04 21:03
leppie22-Aug-04 21:03 
GeneralProblem in HTTP POST Pin
khchan22-Aug-04 18:49
khchan22-Aug-04 18:49 
GeneralRe: Problem in HTTP POST Pin
LongRange.Shooter23-Aug-04 7:40
LongRange.Shooter23-Aug-04 7:40 
GeneralWinForms -> Submit (POST) to a web page and get results Pin
theoutlander22-Aug-04 18:36
theoutlander22-Aug-04 18:36 
GeneralRe: WinForms -> Submit (POST) to a web page and get results Pin
Mazdak22-Aug-04 19:30
Mazdak22-Aug-04 19:30 
GeneralProfessional database advice Pin
steve_rm22-Aug-04 18:03
steve_rm22-Aug-04 18:03 
GeneralRe: Professional database advice Pin
Mazdak22-Aug-04 19:18
Mazdak22-Aug-04 19:18 
GeneralRe: Professional database advice Pin
steve_rm23-Aug-04 5:25
steve_rm23-Aug-04 5:25 
GeneralMarshalling struct with array member Pin
rana7422-Aug-04 15:41
rana7422-Aug-04 15:41 
GeneralRe: Marshalling struct with array member Pin
leppie23-Aug-04 3:51
leppie23-Aug-04 3:51 
QuestionHow to export data from datagrid to excel? Pin
tzewei22-Aug-04 14:15
tzewei22-Aug-04 14:15 

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.