Author | Message | Time |
---|---|---|
PiaNKA | The two functions in NBBot called UDPChecksum() and SubChecksum(), are they proven to work? | June 23, 2004, 9:41 PM |
GoSuGaMING | [quote author=PiaNKA link=board=17;threadid=7407;start=0#msg66871 date=1088026878] The two functions in NBBot called UDPChecksum() and SubChecksum(), are they proven to work? [/quote] test them :X | June 23, 2004, 10:12 PM |
Myndfyr | A little rant on forum etiquette... 1.) If you wanted this to go to Adron, you should have sent him a private message. If you wanted other people to reply to your question, a more descriptive title, such as "Accuracy of NBBot Checksum functions" might have been more appropriate. 2.) Gosu -- this might be a bit of a suprise to you, but you don't have to reply to *every* thread. You don't contribute much at all to the realm of original knowledge. To suggest that he "test" the functions would be to suggest that he compile a list of all possible input and output values and run them through the function. Impractical, I might say. And warzone's thread -- your blinding revelation of "buy a book" (where one or two people had already suggested it) is the same way. Perhaps suggesting a specific book would have been helpful, but what you said was just a way to get your name on the post. And I'm spent. | June 23, 2004, 11:11 PM |
PiaNKA | Please accept my apology;) | June 24, 2004, 12:18 AM |
GoSuGaMING | [quote author=Myndfyre link=board=17;threadid=7407;start=0#msg66892 date=1088032260] A little rant on forum etiquette... 1.) If you wanted this to go to Adron, you should have sent him a private message. If you wanted other people to reply to your question, a more descriptive title, such as "Accuracy of NBBot Checksum functions" might have been more appropriate. 2.) Gosu -- this might be a bit of a suprise to you, but you don't have to reply to *every* thread. You don't contribute much at all to the realm of original knowledge. To suggest that he "test" the functions would be to suggest that he compile a list of all possible input and output values and run them through the function. Impractical, I might say. And warzone's thread -- your blinding revelation of "buy a book" (where one or two people had already suggested it) is the same way. Perhaps suggesting a specific book would have been helpful, but what you said was just a way to get your name on the post. And I'm spent. [/quote] is this a wasted post? just like wasted bandwidth to brighten the day! | June 24, 2004, 1:52 AM |
Zakath | GoSuGaMING: This might also come as a surprise to you, but a lot of people here think you are a complete and total ass. If you don't clean up your act, I will request that you be banned from the forum - and I'm on excellent terms with the forum admins, so my request WILL be granted. You have been warned. | June 24, 2004, 1:54 AM |
Lenny | On a lighter note, can anyone post UDPChecksum() and SubChecksum() (maybe Pianka)? I'm curious as to what it looks like and how it works.... | June 24, 2004, 2:10 AM |
KkBlazekK | [quote author=Zakath link=board=17;threadid=7407;start=0#msg66928 date=1088042074] GoSuGaMING: This might also come as a surprise to you, but a lot of people here thing you are a complete and total ass.[/quote] I agree totally. | June 24, 2004, 2:14 AM |
R.a.B.B.i.T | [quote author=Kk)Blaze(kK link=board=17;threadid=7407;start=0#msg66931 date=1088043251] [quote author=Zakath link=board=17;threadid=7407;start=0#msg66928 date=1088042074] GoSuGaMING: This might also come as a surprise to you, but a lot of people here thing you are a complete and total ass.[/quote] I agree totally. [/quote]Second. Anyway, I'd also like to see these functions. | June 24, 2004, 2:20 AM |
PaiD | [code] unsigned long subchecksum(unsigned char *buf, int len) { unsigned sum1=0, sum2=0; unsigned char *p; p = buf+len-1; while(len--) { sum2 += *p--; if(sum2 > 0xff) sum2 -= 0xff; sum1 += sum2; } return ((sum2 & 0xff)<<8) | ((sum1 % 0xff) & 0xff); } [/code] I cant find the other | June 24, 2004, 2:48 AM |
Newby | [code]Public Function UDPChecksum(ByVal buffer As String, ByVal size As Long) As Long Dim a&, b&, n&, q&, sum& For n = 0 To size - 1 a = a + ((n + 1) * Asc(Mid$(buffer, n + 1, 1))) b = b + ((n + 2) * Asc(Mid$(buffer, n + 1, 1))) Next n q = a While (q > &HFF) q = (q / &H100) + (q Mod &H100) Wend sum = q q = b While (q > &HFF) q = (q / &H100) + (q Mod &H100) Wend sum = sum + (LShift(&HFF - q, 8)) UDPChecksum = sum End Function [/code] | June 24, 2004, 5:00 AM |
KkBlazekK | And the vb version of checksum... [code] Public Sub InitCRC32() Dim i As Long, J As Long, K As Long, XorVal As Long Static CRC32Initialized As Boolean If CRC32Initialized Then Exit Sub CRC32Initialized = True For i = 0 To 255 K = i For J = 1 To 8 If K And 1 Then XorVal = CRC32_POLYNOMIAL Else XorVal = 0 If K < 0 Then K = ((K And &H7FFFFFFF) \ 2) Or &H40000000 Else K = K \ 2 K = K Xor XorVal Next CRC32Table(i) = K Next End Sub Public Function CRC32(ByVal data As String) As Long Dim i As Long, J As Long Call InitCRC32 CRC32 = &HFFFFFFFF For i = 1 To Len(data) J = CByte(Asc(Mid(data, i, 1))) Xor (CRC32 And &HFF&) If CRC32 < 0 Then CRC32 = ((CRC32 And &H7FFFFFFF) \ &H100&) Or &H800000 Else CRC32 = CRC32 \ &H100& CRC32 = CRC32 Xor CRC32Table(J) Next CRC32 = Not CRC32 End Function 'Put this in some module... Public Const CRC32_POLYNOMIAL As Long = &HEDB88320 Public CRC32Table(0 To 255) As Long[/code] | June 24, 2004, 5:21 AM |
UserLoser. | [quote author=Kk)Blaze(kK link=board=17;threadid=7407;start=0#msg66969 date=1088054503] And the vb version of checksum... [/quote] Wrong checksum -- read the thread before replying. | June 24, 2004, 5:52 AM |
PiaNKA | So does that mean nobody is gonna post it for me? :( | June 27, 2004, 8:11 PM |
hismajesty | [quote author=Zakath link=board=17;threadid=7407;start=0#msg66928 date=1088042074] GoSuGaMING: This might also come as a surprise to you, but a lot of people here think you are a complete and total ass. If you don't clean up your act, I will request that you be banned from the forum - and I'm on excellent terms with the forum admins, so my request WILL be granted. You have been warned. [/quote] You forgot "moron!" | June 27, 2004, 8:48 PM |
BaDDBLooD | Would someone explain what those 2 functions are used for? I am a little lost >:( | June 28, 2004, 4:47 AM |
dRAgoN | [quote author=BaDDBLooD link=board=17;threadid=7407;start=15#msg67535 date=1088398022] Would someone explain what those 2 functions are used for? I am a little lost >:( [/quote] udp packet checksum which is used for the games that use udp. | June 28, 2004, 4:59 AM |
BaDDBLooD | Which games would that be? | June 28, 2004, 5:13 AM |
GoSuGaMING | [quote author=BaDDBLooD link=board=17;threadid=7407;start=15#msg67545 date=1088399610] Which games would that be? [/quote] prolly starcraft & Broodwar | June 28, 2004, 5:20 AM |
Grok | [quote author=GoSuGaMING link=board=17;threadid=7407;start=0#msg66927 date=1088041938] [quote author=Myndfyre link=board=17;threadid=7407;start=0#msg66892 date=1088032260] A little rant on forum etiquette... 1.) If you wanted this to go to Adron, you should have sent him a private message. If you wanted other people to reply to your question, a more descriptive title, such as "Accuracy of NBBot Checksum functions" might have been more appropriate. 2.) Gosu -- this might be a bit of a suprise to you, but you don't have to reply to *every* thread. You don't contribute much at all to the realm of original knowledge. To suggest that he "test" the functions would be to suggest that he compile a list of all possible input and output values and run them through the function. Impractical, I might say. And warzone's thread -- your blinding revelation of "buy a book" (where one or two people had already suggested it) is the same way. Perhaps suggesting a specific book would have been helpful, but what you said was just a way to get your name on the post. And I'm spent. [/quote] is this a wasted post? just like wasted bandwidth to brighten the day! [/quote] It is only wasted if you don't learn from it that many forum regulars consider your posts to be drivel. | June 28, 2004, 11:27 AM |
iago | [quote author=PiaNKA link=board=17;threadid=7407;start=0#msg66871 date=1088026878] The two functions in NBBot called UDPChecksum() and SubChecksum(), are they proven to work? [/quote] As far as I know, they work. They've been around for years, so they must be doing something right. Whoever asked for the function -- this can be gotten from the NBBot source code, which can be found at, among other places, at warz' site --> [s]http://tks.slacktech.com[/s] Ok, the actual page is Here if you don't want to make the 2 clicks to find it (source, then cpp). | June 28, 2004, 12:14 PM |