This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
importPackage(java.net); | |
importPackage(java.io); | |
importPackage(java.util); | |
// Base64.js | |
//https://raw.githubusercontent.com/davidchambers/Base64.js/master/LICENSE | |
;(function () { | |
var object = typeof exports != 'undefined' ? exports : this; // #8: web workers | |
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Base64.js | |
//https://raw.githubusercontent.com/davidchambers/Base64.js/master/LICENSE | |
function InvalidCharacterError(message) { | |
this.message = message; | |
} | |
InvalidCharacterError.prototype = new Error; | |
InvalidCharacterError.prototype.name = 'InvalidCharacterError'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.replaceAll = function(search, replacement) { | |
var target = this; | |
return target.split(search).join(replacement); | |
}; | |
function Base64URLEncode (input) { | |
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; | |
var temp = String(temp).replaceAll("+","-").replaceAll("/","_") | |
var str = String(input); | |
for ( |