Posts: 3,343
Threads: 83
Joined: Mar 2003
[to me as webmaster of qbnz]
_____________
Do you know where I can go to get quick basic utility on CRC error checking?
I need a utility that can generate CRC -16 error checking.
Any help would be most appreciated!
Posts: 1,556
Threads: 298
Joined: Dec 2002
Posts: 3,343
Threads: 83
Joined: Mar 2003
^^^ is that increasing post count?
As webmaster of a "big" qb site I recieve mail like this all the time...
Posts: 2,771
Threads: 96
Joined: Oct 2003
Do you actually have any idea what he means? Have you tried google on CRC - 16?
Posts: 6,419
Threads: 74
Joined: Mar 2002
CRC means Cyclic Redundance Check. It is used to check if some data is correct. A CRC value is generated upon the data doing some math, and then it is used to compare it with received/extracted data to see if it has been received/extracted correctly.
CRC16 means that the CRC is 16 bits long.
This code takes a text string and returns the CRC16 code associated:
Code:
BBS: Inland Empire Archive
Date: 02-14-93 (22:02) Number: 304
From: DOUGLAS LUSHER Refer#: NONE
To: ALL Recvd: NO
Subj: CRC16 Conf: (2) Quik_Bas Someone requested code for 16 bit CRC not long ago. Some code
was posted in response, but I thought I would post mine too. This
routine should be much faster than the code posted previously, and
if speed is critical, this can be made to run even faster with
just a bit of ASM code. If some one requests it, I will post that.
Also note that the previously posted code returns the CRC in a
long integer, my routine returns an integer.
DEFINT A-Z
FUNCTION CRC16% (Target$)
'returns the 16 bit CRC for the supplied string
'by Douglas H. Lusher, 13 Feb 1993
STATIC Initialized%, CRCTable%()
IF Initialized% GOTO CalcCRC16
REDIM CRCTable%(255)
FOR Ptr% = 0 TO 255
CRC& = Ptr% * 256&
FOR Bit% = 0 TO 7
Carry% = ((CRC& AND &H8000) <> 0)
CRC& = (CRC& * 2) AND &HFFFF&
CRC& = CRC& XOR (Carry% AND &H1021)
NEXT
CRCTable%(Ptr%) = (CRC& - 32768) XOR &H8000
NEXT
Initialized% = -1
CalcCRC16:
CRC& = 0
FOR Ptr% = 1 TO LEN(Target$)
Char% = ASC(MID$(Target$, Ptr%))
CRC& = CRC& * &H100
CRC& = CRCTable%(((CRC& AND &HFF0000)\ &H10000) XOR Char%) _
XOR (CRC& AND &HFF00&) 'append this to the line above
NEXT
CRC16% = ((CRC& AND &HFFFF&) - 32768) XOR &H8000
END FUNCTION
--- TMail v1.30.4
* Origin: TC-AMS MLTBBS 2.2 - Minnetonka, MN (612)-938-4799 (1:282/7)
Posts: 1,556
Threads: 298
Joined: Dec 2002
Quote:^^^ is that increasing post count?
As webmaster of a "big" qb site I recieve mail like this all the time...
Oooooooooooooooooh, I'm sorry. The little line you put in the post made the rest of it look like your sig, so it pretty much just looked like
Quote:[to me as webmaster of qbnz]
....and so, yeah. I had no idea.
Can't answer your question...
Posts: 3,279
Threads: 170
Joined: Nov 2003
CRC32 would be better.
I'd knock on wood, but my desk is particle board.
Posts: 4,307
Threads: 63
Joined: May 2003
Quote:.................yay?
And you pester me about posting useless posts :barf:
Posts: 2,771
Threads: 96
Joined: Oct 2003
TBBQ: read his second post... :roll:
Posts: 4,307
Threads: 63
Joined: May 2003