lib/card.js
function (packName, cardName, inputValues, callback) {
    var DB = require('../index').db;
    
    // Go through the input values and base64 them if they aren't already.
    var allBase64 = true;
    _.each(_.keys(inputValues), function (key) {
      if (!/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/.test(inputValues[key])) {
        allBase64 = false;
      }
    });
    
    // If not all inputs are base64, then we'll convert them for the user (backward compatibility). 
    if (!allBase64) {
      _.each(_.keys(inputValues), function (key) {
        inputValues[key] = Base64.encode(inputValues[key]);
      });
    }
    
    DB.lock(packName, cardName, inputValues, process.env.LOCK_KEY, function (err, token) {
      if (!err) {
        callback && callback(null, token);
      }
      else {
        callback && callback(err);
      }
    });
  }
function (packName, cardName, inputValues, callback) {
    var DB = require('../index').db;
    
    // Go through the input values and base64 them if they aren't already.
    var allBase64 = true;
    _.each(_.keys(inputValues), function (key) {
      if (!/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/.test(inputValues[key])) {
        allBase64 = false;
      }
    });
    
    // If not all inputs are base64, then we'll convert them for the user (backward compatibility). 
    if (!allBase64) {
      _.each(_.keys(inputValues), function (key) {
        inputValues[key] = Base64.encode(inputValues[key]);
      });
    }
    
    DB.lock(packName, cardName, inputValues, process.env.LOCK_KEY, function (err, token) {
      if (!err) {
        callback && callback(null, token);
      }
      else {
        callback && callback(err);
      }
    });
  }
function ( packName , cardName , inputValues , callback ) { var DB = require ( '../index' ) . db ; // Go through the input values and base64 them if they aren't already. var allBase64 = true ; _ . each ( _ . keys ( inputValues ) , function ( key ) { if ( ! / ^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$ / . test ( inputValues [ key ] ) ) { allBase64 = false ; } } ) ; // If not all inputs are base64, then we'll convert them for the user (backward compatibility).  if ( ! allBase64 ) { _ . each ( _ . keys ( inputValues ) , function ( key ) { inputValues [ key ] = Base64 . encode ( inputValues [ key ] ) ; } ) ; } DB . lock ( packName , cardName , inputValues , process . env . LOCK_KEY , function ( err , token ) { if ( ! err ) { callback && callback ( null , token ) ; } else { callback && callback ( err ) ; } } ) ; }
Secure card inputs such as passwords and API keys sop they cannot be read by users.

@method secureInputs
@async
@param {String}   packName     The pack this data belongs to.
@param {String}   cardName     The card this data belongs to.
@param {Object}   inputValues  The values that you want to be secured.
@param {Function} [callback]   Optional callback function to retrieve the secure token that can be used to render a card.
Secure card inputs such as passwords and API keys sop they cannot be read by users .