home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 20.8 Encrypt()
- Author: Joe Booth
- Excerpted from "Clipper 5: A Developer's Guide"
- Copyright (c) 1991 M&T Books
- 501 Galveston Drive
- Redwood City, CA 94063-4728
- (415) 366-3600
- */
-
- //───── NOTE: must compile with the /N option!
-
- function encrypt(src_word,passkey)
- LOCAL pwd:="",jj,kk:=0,x
- passkey:=if(passkey=NIL,"CLIPPER",passkey)
- for jj=len(src_word) to 1 step -1
- kk :=if(kk>len(passkey),1,kk)
- x :=asc(substr(src_word,jj,1)) + asc(substr(passkey,kk,1))
- pwd += chr(x)
- next
- return pwd
-
- // end of file CHP2008.PRG
-