Click here to Skip to main content
15,923,168 members
Home / Discussions / C#
   

C#

 
GeneralRe: Reading csv file into a dataTable Pin
PIEBALDconsult17-Sep-08 16:44
mvePIEBALDconsult17-Sep-08 16:44 
QuestionGet a value ID from a ListBox,which is bind to a Data source. Pin
CJGun16-Sep-08 23:06
CJGun16-Sep-08 23:06 
AnswerRe: Get a value ID from a ListBox,which is bind to a Data source. Pin
CJGun17-Sep-08 19:15
CJGun17-Sep-08 19:15 
Questioncsv imports Pin
rahuladya16-Sep-08 23:05
rahuladya16-Sep-08 23:05 
AnswerRe: csv imports Pin
Giorgi Dalakishvili16-Sep-08 23:14
mentorGiorgi Dalakishvili16-Sep-08 23:14 
GeneralRe: csv imports Pin
Alan Balkany17-Sep-08 4:15
Alan Balkany17-Sep-08 4:15 
GeneralRe: csv imports Pin
Giorgi Dalakishvili17-Sep-08 4:21
mentorGiorgi Dalakishvili17-Sep-08 4:21 
AnswerRe: csv imports Pin
Mohammed Hameed17-Sep-08 1:00
professionalMohammed Hameed17-Sep-08 1:00 
GeneralRe: csv imports Pin
Ashfield17-Sep-08 1:22
Ashfield17-Sep-08 1:22 
Questionset Icon in the Add/Remove program Pin
lune1216-Sep-08 21:50
lune1216-Sep-08 21:50 
AnswerRe: set Icon in the Add/Remove program Pin
Muammar©17-Sep-08 0:53
Muammar©17-Sep-08 0:53 
Questionif a form is already opened ,new form should not been opened Pin
maifs16-Sep-08 21:46
maifs16-Sep-08 21:46 
AnswerRe: if a form is already opened ,new form should not been opened Pin
Nagy Vilmos16-Sep-08 23:43
professionalNagy Vilmos16-Sep-08 23:43 
AnswerRe: if a form is already opened ,new form should not been opened Pin
DaveyM6916-Sep-08 23:55
professionalDaveyM6916-Sep-08 23:55 
QuestionUndo Off/Disable/Suspend Pin
Khaleek Ahmad16-Sep-08 21:46
Khaleek Ahmad16-Sep-08 21:46 
Questionsystem time Pin
lankaudaranga16-Sep-08 20:56
lankaudaranga16-Sep-08 20:56 
AnswerRe: system time Pin
Giorgi Dalakishvili16-Sep-08 21:02
mentorGiorgi Dalakishvili16-Sep-08 21:02 
QuestionC++ Crc Method to C# Crc Method Pin
Programm3r16-Sep-08 20:56
Programm3r16-Sep-08 20:56 
AnswerRe: C++ Crc Method to C# Crc Method Pin
Guffa16-Sep-08 21:24
Guffa16-Sep-08 21:24 
QuestionRe: C++ Crc Method to C# Crc Method Pin
Programm3r16-Sep-08 21:40
Programm3r16-Sep-08 21:40 
AnswerRe: C++ Crc Method to C# Crc Method Pin
leppie16-Sep-08 21:48
leppie16-Sep-08 21:48 
QuestionRe: C++ Crc Method to C# Crc Method Pin
Programm3r16-Sep-08 21:52
Programm3r16-Sep-08 21:52 
AnswerRe: C++ Crc Method to C# Crc Method Pin
leppie16-Sep-08 22:09
leppie16-Sep-08 22:09 
GeneralRe: C++ Crc Method to C# Crc Method Pin
Programm3r16-Sep-08 22:16
Programm3r16-Sep-08 22:16 
AnswerRe: C++ Crc Method to C# Crc Method Pin
Guffa16-Sep-08 22:49
Guffa16-Sep-08 22:49 
You have changed the type from ushort to uint, I'm not sure that works properly.

Do you really want to use unsafe code and pointers? Why not just use a string?

The InitialCrc value isn't used in the method at all, so you should remove it.

ushort crc16(string buffer) {
   ushort crc = 0;
   foreach (char c in buffer) {
      crc = (crc >> 8) | (crc << 8);
      crc ^= (ushort)c;
      crc ^= (crc & 0xff) >> 4;
      crc ^= crc << 12;
      crc ^= (crc & 0xff) << 5;
   }
   return crc;
}


Despite everything, the person most likely to be fooling you next is yourself.

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.