'从 Base64 改进而来的字符编码
'B64_Alpha 密钥直接用ASC  
'B64_Alpha 值 34--61 ，随机取值，每次编码，结果不同。
Function YF_BaseDecode( ByVal InBuff as String ) as String
    Dim as Integer w1,w2,w3,w4,n,b 
    Dim retry as String
    Dim By as UByte Ptr
    Dim B64_Alpha as UByte 
    retry=String(Len(InBuff),0)
    by=StrPtr(retry)
    B64_Alpha=Asc(InBuff,1) 
    b = -1
       For n = 2 To Len(InBuff) Step 4

          w1 = Asc(InBuff, n)-B64_Alpha'-55 - 2
          w2 = Asc(InBuff, n + 1)-B64_Alpha'-55 - 2
          w3 = Asc(InBuff, n + 2)-B64_Alpha '-55 - 2
          w4 = Asc(InBuff, n + 3)-B64_Alpha '-55 - 2
            If w2 >= 0 Then
                b = b + 1
                By[b] = (w1 * 4 + Int(w2 / 16)) And 255
            End If
            If w3 >= 0 Then
                b = b + 1
                By[b] = (w2 * 16 + Int(w3 / 4)) And 255
            End If
            If w4 >= 0 Then
                b = b + 1
                By[b] = (w3 * 64 + w4) And 255
            End If
            
       Next
'    b=InStr(retry,Chr(0))
'    If b>0 Then retry=Left(retry,b-1)       'return the decoded string
Function =Left(retry,b+1)
End Function