home *** CD-ROM | disk | FTP | other *** search
- ********************
-
- FUNCTION Checksum
-
- * Written and contributed by ESSOR MASO
-
- PARAMETERS _astring
-
- IF TYPE("_astring") != "C"
- RETURN("")
- ENDIF
-
- PRIVATE _sum, _l, _qaz
-
- _sum = 0
- _l = LEN(_astring)
- FOR _qaz =1 TO _l
- _sum = _sum + ASC(SUBSTR(_astring,_qaz,1))
- NEXT
- IF _l = 0
- RETURN(0)
- ELSE
- * 16777216=2^24, 4294967296=2^32
- RETURN((16777216 * _l - 256*ASC(SUBSTR(_astring,1,1))+;
- _sum * 257)%4294967296)
- ENDIF
-
- * End of File