脚本宝典收集整理的这篇文章主要介绍了用ASP编写的加密和解密类,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
class&nbs
p;Base64Class
rem Const
dim sBASE_64_CHARACTERS'转化码
dim lenString '计算字符串的长度
dim iCount '计数器
dim returnValue '返回值
dim tempChar'缓存字符
dim tempString'缓存字符串
dim par
amString '参数字符串
dim temHex'缓存缓存十六进制
dim tempLow'缓存低位
dim tempHigh'缓存高位
dim 
;mod3String'
dim mod4String'
dim tempBinary'
dim tempByteOne'
dim tempByteTwo'
dim tempByteT
hree'
dim tempByteFour'
dim tempSaveB
ITsOne'
dim tempSaveBitsTwo'
'********************************************
'be
gin初始化类
'********************************************
PRivate s
ub Class_Initialize()
sBASE_64_CHARACTERS = "
abcDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" end sub
'********************************************
'end初始化类 '
********************************************
'********************************************
'begin销毁类
'********************************************
Private Sub Class_Terminate()
sBASE_64_CHARACTERS="" end sub
'********************************************
'end销毁类
'********************************************
'********************************************
'begin将Ansi编码的字符串进行Base64编码
'********************************************
public function Encode(paramString)
tempString=""
returnValue=""
lenString=len(paramString)
if lenString<1 then
Encode=returnValue
else
mod3String=lenString mod 3
'补足位数是为了便于计算
if mod3String>0 then
lenString=lenString+3-mod3String
lenString=lenString-3
end if
脚本宝典总结
以上是脚本宝典为你收集整理的用ASP编写的加密和解密类全部内容,希望文章能够帮你解决用ASP编写的加密和解密类所遇到的问题。
如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。