Sha256: 0ae63c7646c2f113daaa167bd0a27b4637a59726142aa26575fcc15b18af45ca

Contents?: true

Size: 866 Bytes

Versions: 19

Compression:

Stored size: 866 Bytes

Contents

/*
 * base64.js: An extremely simple implementation of base64 encoding / decoding using node.js Buffers
 *
 * (C) 2010, Nodejitsu Inc.
 *
 */

var base64 = exports;

//
// ### function encode (unencoded)
// #### @unencoded {string} The string to base64 encode
// Encodes the specified string to base64 using node.js Buffers.
//
base64.encode = function (unencoded) {
  var encoded;

  try {
    encoded = new Buffer(unencoded || '').toString('base64');
  }
  catch (ex) {
    return null;
  }

  return encoded;
};

//
// ### function decode (encoded)
// #### @encoded {string} The string to base64 decode
// Decodes the specified string from base64 using node.js Buffers.
//
base64.decode = function (encoded) {
  var decoded;

  try {
    decoded = new Buffer(encoded || '', 'base64').toString('utf8');
  }
  catch (ex) {
    return null;
  }

  return decoded;
};

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/utile/lib/base64.js
xcodebuild-helper-1.2.3 externals/ios-sim-master/node_modules/utile/lib/base64.js
hooch-0.4.2 jasmine/node_modules/karma/node_modules/http-proxy/node_modules/utile/lib/base64.js
hooch-0.4.1 jasmine/node_modules/karma/node_modules/http-proxy/node_modules/utile/lib/base64.js
hooch-0.4.0 jasmine/node_modules/karma/node_modules/http-proxy/node_modules/utile/lib/base64.js
hooch-0.3.0 jasmine/node_modules/karma/node_modules/http-proxy/node_modules/utile/lib/base64.js
hooch-0.2.1 jasmine/node_modules/karma/node_modules/http-proxy/node_modules/utile/lib/base64.js
hooch-0.2.0 jasmine/node_modules/karma/node_modules/http-proxy/node_modules/utile/lib/base64.js
hooch-0.1.0 jasmine/node_modules/karma/node_modules/http-proxy/node_modules/utile/lib/base64.js
hooch-0.0.8 jasmine/node_modules/karma/node_modules/http-proxy/node_modules/utile/lib/base64.js
hooch-0.0.7 jasmine/node_modules/karma/node_modules/http-proxy/node_modules/utile/lib/base64.js
hooch-0.0.6 jasmine/node_modules/karma/node_modules/http-proxy/node_modules/utile/lib/base64.js
entangled-0.0.16 spec/dummy/public/node_modules/karma/node_modules/http-proxy/node_modules/utile/lib/base64.js
entangled-0.0.15 spec/dummy/public/node_modules/karma/node_modules/http-proxy/node_modules/utile/lib/base64.js
entangled-0.0.14 spec/dummy/public/node_modules/karma/node_modules/http-proxy/node_modules/utile/lib/base64.js
entangled-0.0.13 spec/dummy/public/node_modules/karma/node_modules/http-proxy/node_modules/utile/lib/base64.js
entangled-0.0.12 spec/dummy/public/node_modules/karma/node_modules/http-proxy/node_modules/utile/lib/base64.js
entangled-0.0.11 spec/dummy/public/node_modules/karma/node_modules/http-proxy/node_modules/utile/lib/base64.js
entangled-0.0.10 spec/dummy/public/node_modules/karma/node_modules/http-proxy/node_modules/utile/lib/base64.js