Divide the length of the input string by 4, take the remainder. If it is 2, add two =
characters at the end. If it is 3, add one =
character at the end.
You now have Base64-URL with padding.
/* EventManager, v1.0.1 | |
* | |
* Copyright (c) 2009, Howard Rauscher | |
* Licensed under the MIT License | |
*/ | |
(function() { | |
function EventManager() { | |
this._listeners = {}; |
[user] | |
name = MY_NAME | |
email = MY_EMAIL_ADDRESS | |
[git-tmbundle] | |
gitnub-path = /Applications/GitNub.app | |
gitx-path = /Applications/GitX.app | |
show-diff-check = yes | |
[github] | |
user = GITUB_USER | |
token = GITHUB_TOKEN |
// This is from my comment here: http://wolfram.kriesing.de/blog/index.php/2008/javascript-remove-element-from-array/comment-page-2#comment-466561 | |
/* | |
* How to delete items from an Array in JavaScript, an exhaustive guide | |
*/ | |
// DON'T use the delete operator, it leaves a hole in the array: | |
var arr = [4, 5, 6]; | |
delete arr[1]; // arr now: [4, undefined, 6] |
from Crypto import HMAC, SHA256 | |
def hmac_sha256(key, msg): | |
hash_obj = HMAC.new(key=key, msg=msg, digestmod=SHA256) | |
return hash_obj.hexdigest() |
set -xg PYTHONPATH /opt/eleccion/ $PYTHONPATH | |
set -xg PYTHONPATH /opt/operaciones/ $PYTHONPATH | |
set -xg GOROOT /usr/local/go $GOROOT | |
set -xg PATH /usr/local/go/bin $PATH | |
set -xg EDITOR vim $EDITOR | |
setenv EDITOR vim | |
function l | |
ll $argv |
/* | |
* Tween.js | |
* t: current time(当前时间); | |
* b: beginning value(初始值); | |
* c: change in value(变化量); | |
* d: duration(持续时间)。 | |
* you can visit 'http://easings.net/zh-cn' to get effect | |
*/ | |
var Tween = { |
// Get binary file using XMLHttpRequest | |
function getBinary(file) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open("GET", file, false); | |
xhr.overrideMimeType("text/plain; charset=x-user-defined"); | |
xhr.send(null); | |
return xhr.responseText; | |
} | |
// Base64 encode binary string |