Revisions
-
jhurliman revised this gist
Sep 30, 2011 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -18,11 +18,11 @@ base64.decode = function(encoded) { base64.urlEncode = function(unencoded) { var encoded = base64.encode(unencoded); return encoded.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); }; base64.urlDecode = function(encoded) { encoded = encoded.replace(/-/g, '+').replace(/_/g, '/'); while (encoded.length % 4) encoded += '='; return base64.decode(encoded); -
jhurliman revised this gist
Sep 29, 2011 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,7 @@ * base64.js: An extremely simple implementation of base64 encoding / decoding using node.js Buffers * * (C) 2010, Nodejitsu Inc. * (C) 2011, Cull TV, Inc. * */ -
jhurliman revised this gist
Sep 29, 2011 . 1 changed file with 15 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,10 +7,22 @@ var base64 = exports; base64.encode = function(unencoded) { return new Buffer(unencoded || '').toString('base64'); }; base64.decode = function(encoded) { return new Buffer(encoded || '', 'base64').toString('utf8'); }; base64.urlEncode = function(unencoded) { var encoded = base64.encode(unencoded); return encoded.replace('+', '-').replace('/', '_').replace(/=+$/, ''); }; base64.urlDecode = function(encoded) { encoded = encoded.replace('-', '+').replace('_', '/'); while (encoded.length % 4) encoded += '='; return base64.decode(encoded); }; -
Marak created this gist
Feb 8, 2011 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ /* * base64.js: An extremely simple implementation of base64 encoding / decoding using node.js Buffers * * (C) 2010, Nodejitsu Inc. * */ var base64 = exports; base64.encode = function (unencoded) { return new Buffer(unencoded || '').toString('base64'); }; base64.decode = function (encoded) { return new Buffer(encoded || '', 'base64').toString('utf8'); };