|
,加密的那个函数不知道怎么调用,请大家帮帮忙写一下
加密:
将字符串按字节连成位串,从头至尾每次取6位.值加60,就成为一个加密字节,
最后不足6位时在后面以0补齐6位.即得到加密字符串
Private Function PlaToChi(inBin() As Byte, inLen As Integer) As Integer
Dim iT As Integer, oT As Integer, strBin(2047) As Byte
inLen = inLen + 12
PlaToChi = (inLen * 8 + 5) \ 6
Do Until iT >= inLen
strBin(oT) = ((inBin(iT) And &HFC) \ 4) + &H3C
oT = oT + 1
strBin(oT) = ((inBin(iT) And &H3) * 16 Or (inBin(iT + 1) And &HF0) \ 16) + &H3C
oT = oT + 1: iT = iT + 1
strBin(oT) = (((inBin(iT) And &HF) * 4) Or (inBin(iT + 1) And &HC0) \ 64) + &H3C
oT = oT + 1: iT = iT + 1
strBin(oT) = (inBin(iT) And &H3F) + &H3C
oT = oT + 1: iT = iT + 1
Loop
ReDim inBin(PlaToChi - 1)
CopyMemory inBin(0), strBin(0), PlaToChi
End Function
|
|