Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Native VFP Encryption Code
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01294514
Message ID:
01294578
Vues:
16
>Anyone have a native VFP encryption/decryption class I can have?

Hi

Hope this work :)
Function encrypx(mstring,mcryp)
If Vartype(mcryp) <> 'C'
	mcryp = 'mypass'
Endif
If ISNULL(mstring) OR empty(mstring)
	retval = ''
ELSE
	Local lenstr,lencry,retval,lchaval,lcnxt,aaa
	retval = ''
	lcnxt = 0
	aaa = 0
	lenstr = Len(Alltrim(mstring))
	lencry = Len(Alltrim(mcryp))
	For aaa = 1 To lenstr
		If lcnxt > lencry
			lcnxt = 1
		Else
			lcnxt = lcnxt+1
		Endif
		retval = retval + Chr(Asc(Substr(mstring,aaa,1))+Asc(Substr(mcryp,lencry,1)))
	Endfor
Endif
Return retval

Function decrypx(mstring,mcryp)
If Vartype(mcryp) <> 'C'
	mcryp = 'mypass'
ENDIF
If Isnull(mstring) OR empty(mstring)
	retval = ''
ELSE
	Local lenstr,lencry,retval,lchaval,lcnxt,aaa
	retval = ''
	lcnxt = 0
	aaa = 0
	lenstr = Len(Alltrim(mstring))
	lencry = Len(Alltrim(mcryp))
	For aaa = 1 To lenstr
		If lcnxt > lencry
			lcnxt = 1
		Else
			lcnxt = lcnxt+1
		Endif
		retval = retval + Chr(Asc(Substr(mstring,aaa,1))-Asc(Substr(mcryp,lencry,1)))
	Endfor
Endif
Return retval
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform