-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbase64Encode.bas
More file actions
27 lines (20 loc) · 766 Bytes
/
base64Encode.bas
File metadata and controls
27 lines (20 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
'''''''''''''''''''''''''''''''''''''''''''''''
' Convert String to Base64 encoding '
'''''''''''''''''''''''''''''''''''''''''''''''
' recieves input of type String
' outputs same string with base64 encoding applied
Function base64Encode(input as String) As String
'dimension tools
Dim oXML, oNode
Set oXML = CreateObject("Msxml2.DOMDocument.3.0")
Set oNode = oXML.createElement("base64")
'set datatype
oNode.DataType = "bin.base64"
'encode to base64
oNode.nodeTypedValue = Stream_StringToBinary(sText)
'return
Base64Encode = Replace(oNode.Text, vbLf, "")
'garbage collection
Set oNode = Nothing
Set oXML = Nothing
End Function