|
-
Aug 21st, 2001, 10:23 AM
#1
Thread Starter
Frenzied Member
What the !@#!@ is a checksum??
Ive been hearing the term lately...whats a checksum? Is it something used to detect whether your program is being cracked or something??
You just proved that sig advertisements work.
-
Aug 21st, 2001, 10:26 AM
#2
PowerPoster
no, it goes on the end of something that verifies the data befoere it. If you look at ISBN numbers, you'll see the last number is 0-9 or X, that is the check digit which verifies the rest of it.
It's mainly used for inputting, when it will detect if you have entered any characters wrongly.
-
Aug 21st, 2001, 10:29 AM
#3
Member
I believe it is used in a CRC.
-
Aug 21st, 2001, 10:31 AM
#4
Thread Starter
Frenzied Member
Hmm i feel even stupidier than before...whats a CRC by the way?
You just proved that sig advertisements work.
-
Aug 21st, 2001, 10:53 AM
#5
Member
ZIP files have it for that exact reason.
-
Aug 21st, 2001, 11:01 AM
#6
Thread Starter
Frenzied Member
I dont mean to be a pain...but how do they work? If they're just a few chars at the end of some data then how can they verify the integrity of the entire thing?
You just proved that sig advertisements work.
-
Aug 21st, 2001, 11:22 AM
#7
Addicted Member
The check sum is calulated by the value of each byte and their position therefore some simple packet like:
1234
will not have the same checksum as
4321
So what you do is to calcluate a check sum with the incoming data and see if that answer matchs the one sent in the packet.
For instance a real crappy check sum maker would be
For i = 0 to len
sum = sum + data(i) + (1024^i)
next i
Where data is an array of byte values.
HTH
G
-
Aug 22nd, 2001, 09:06 PM
#8
Registered User
Another crappy checksum, but you will get the idea:
VB Code:
Function Checksum(path As String) As Byte
If len(Dir$(path)) Then
Dim fnum As Long
Dim ByteVar As Byte
fnum = FreeFile
Open path For Binary As #fnum
While Not EOF(fnum)
Get #fnum, , ByteVar 'Get a byte at a time as buffer was defined as a single byte
Checksum = Checksum Xor ByteVar
Wend
Close #fnum
End If
End Function
I think it is faster to do this using asm and then implementing in VB.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|