ASP 中 Base64 的编解码

ASP 中 Base64 的编解码
Base64 编码字符串 与 byte 数组间的互转

VBScript 版本 Function DecodeBase64(str) With CreateObject("Microsoft.XMLDOM").createElement("TXT") .dataType = "bin.base64" .text = str DecodeBase64 = .nodeTypedValue End With End Function Function EncodeBase64(bytes) With CreateObject("Microsoft.XMLDOM").createElement("TXT") .dataType = "bin.base64" .nodeTypedValue = bytes EncodeBase64 = .text End With End Function

JScript 版本 var Base64Encoder = { encode : function(str) { with (Server.CreateObject("Microsoft.XMLDOM").createElement("TXT")) { dataType = "bin.base64"; text = str; return nodeTypedValue; } }, decode : function(bts) { with (Server.CreateObject("Microsoft.XMLDOM").createElement("TXT")) { dataType = "bin.base64"; nodeTypedValue = bts; return text; } } };

你可能感兴趣的:(ASP 中 Base64 的编解码)