Sha256: 87a7e5d8ff4fa9dc7e45158fc0bbff642e477262f6b23aaf646c9fdf984f7f36

Contents?: true

Size: 845 Bytes

Versions: 26

Compression:

Stored size: 845 Bytes

Contents

/*!
 * knox - utils
 * Copyright(c) 2010 LearnBoost <dev@learnboost.com>
 * MIT Licensed
 */

/**
 * Merge object `b` with object `a`.
 *
 * @param {Object} a
 * @param {Object} b
 * @return {Object} a
 * @api private
 */

exports.merge = function(a, b){
  var keys = Object.keys(b);
  for (var i = 0, len = keys.length; i < len; ++i) {
    var key = keys[i];
    a[key] = b[key]
  }
  return a;
};

/**
 * Base64.
 */

exports.base64 = {
  
  /**
   * Base64 encode the given `str`.
   *
   * @param {String} str
   * @return {String}
   * @api private
   */
  
  encode: function(str){
    return new Buffer(str).toString('base64');
  },
  
  /**
   * Base64 decode the given `str`.
   *
   * @param {String} str
   * @return {String}
   * @api private
   */
  
  decode: function(str){
    return new Buffer(str, 'base64').toString();
  }
};

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
vulcan-0.8.2 server/node_modules/knox/lib/knox/utils.js
vulcan-0.8.1 server/node_modules/knox/lib/knox/utils.js
vulcan-0.8.0 server/node_modules/knox/lib/knox/utils.js
vulcan-0.7.2 server/node_modules/knox/lib/knox/utils.js
vulcan-0.7.1 server/node_modules/knox/lib/knox/utils.js
vulcan-0.7.0 server/node_modules/knox/lib/knox/utils.js
vulcan-0.6.1 server/node_modules/knox/lib/knox/utils.js
vulcan-0.6.0 server/node_modules/knox/lib/knox/utils.js
vulcan-0.5.0 server/node_modules/knox/lib/knox/utils.js
vulcan-0.4.0 server/node_modules/knox/lib/knox/utils.js
vulcan-0.3.0 server/node_modules/knox/lib/knox/utils.js
vulcan-0.2.5 server/node_modules/knox/lib/knox/utils.js
vulcan-0.2.4 server/node_modules/knox/lib/knox/utils.js
vulcan-0.2.3 server/node_modules/knox/lib/knox/utils.js
vulcan-0.2.2 server/node_modules/knox/lib/knox/utils.js
vulcan-0.2.1 server/node_modules/knox/lib/knox/utils.js
vulcan-0.2.0 server/node_modules/knox/lib/knox/utils.js
vulcan-0.1.6 server/node_modules/knox/lib/knox/utils.js
vulcan-0.1.5 server/node_modules/knox/lib/knox/utils.js
vulcan-0.1.4 server/node_modules/knox/lib/knox/utils.js