HSH() Function - HASH Function
Syntax
HSH(stringA{,stringB}{,ERR=lineref})
Description
The HSH() function is similar to the CRC() function, except with a different
algorithm (see the CRC() function).
HSH algorithm:
given HSH(A$,B$)
let SEED$=B$ (or $0000$ if B$ not given)
for each byte in A$:
rotate SEED$ one bit to the left
if a 0 bit wrapped around then
rotate SEED$ one bit to the left again
exclusive OR a byte from A$ to low byte of SEED$
return(SEED$)
Examples
>HSH$ = HSH("NOW IS THE TIME")
1000 LET A$=HSH(TEXT$,SEED$,ERR=9500)