VBA-tools / VBA-Web

VBA-Web: Connect VBA, Excel, Access, and Office for Windows and Mac to web services and the web
http://vba-tools.github.io/VBA-Web/
MIT License
2.01k stars 494 forks source link

VBA has no base64url decoder to decode full messages from gmail #251

Closed xaviksio closed 8 years ago

Sophist-UK commented 8 years ago

Correct - VBA doesn't have a base64url encoder/decoder as standard. In fact, VBA doesn't have much as standard (because it is a programming language rather than a framework like .Net).

VBA-Web doesn't have one either at the moment either - but obviously there is nothing to stop anyone from adding one. I don't this will be difficult - as essentially you only need to translate certain characters to/from standard base64 encoding and VBA-Web already has Base64 encode / decode functions in WebHelpers.bas.

A description and some VB.Net code can be found here - and using this VB.Net code as a basis for adding Base64UrlEncode and Base64UrlDecode functions as wrappers to Base64Encode and Base64Decode functions should not be difficult (and would be a useful addition to VBA-Web).

timhall commented 8 years ago

VBA-Web actually already has Base64 support:

WebHelpers.Base64Encode(Text) -> String Code / Docs WebHelpers.Base64Decode(Encoded) -> String Code / Docs

Give it a try and let me know how it works!