BBS: Inland Empire Archive Date: 08-07-92 (18:45) Number: 119 From: TIM HERUM Refer#: NONE To: STEVE MATHIESON Recvd: NO Subj: Squish stuff Conf: (2) Quik_Bas
Steve,
Here is the hash calculation used in the Squish index file. I'll also
send the timestamp and attribute formats in a separate message. Hope this
help. (I sent this Netmail also, but I routed it and have had some trouble
with that so thought I better send it here also). Let me know if you need
anymore help.
The 'To:' field need to be padded with CHR$(0)'s for compatability with
other programs that use the Squish database.
--------------------------8< Cut here 8<-------------------------------------
DEFINT A-Z
DECLARE FUNCTION HashCalc& (TmpStr$)
FUNCTION HashCalc& (TmpStr$)
TmpStr$ = LCASE$(TmpStr$)
FOR Counter = 1 TO LEN(TmpStr$)
TmpVal# = VAL("&H" + RIGHT$(HEX$(TmpVal#) + "0", 8)) +
REM This line scrolled, so append it
ASC(MID$(TmpStr$, Counter, 1))
IF TmpVal# > 2147483647# THEN TmpVal# = TmpVal# - 4294967296#
LftMst$ = LEFT$(RIGHT$("00000000" + HEX$(TmpVal#), 8), 1)
TmpVal# = TmpVal# OR VAL("&H" + LftMst$ + "0")
NEXT Counter
TmpVal# = TmpVal# AND VAL("&H7FFFFFFF")
HashCalc = TmpVal#
END FUNCTION
--------------------------8< Cut here 8<-------------------------------------
->Tim Herum<-
--- Squiggy .830
* Origin: I'd give a shit -- If you'ld take it! (1:124/1014.0)

Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET