lib/identity.js
function createIdentity (ndate, nrandom, nchecksum, epoc) {
  var def = function identity () {
    return _identity(ndate, nrandom, nchecksum, epoc);
  };

  def.EPOC = epoc;
  def.dateLength = ndate;
  def.randomLength = nrandom;
  def.checksumLength = nchecksum;
  def.size = ndate + nrandom + nchecksum;

  def.isValid = function isValid(id) {
    return _isValid(ndate, nrandom, nchecksum, id);
  };
  def.toDate = function toDate(id) {
    return _toDate(ndate, nrandom, nchecksum, epoc, id);
  };

  return def;
}
function createIdentity (ndate, nrandom, nchecksum, epoc) {
  var def = function identity () {
    return _identity(ndate, nrandom, nchecksum, epoc);
  };

  def.EPOC = epoc;
  def.dateLength = ndate;
  def.randomLength = nrandom;
  def.checksumLength = nchecksum;
  def.size = ndate + nrandom + nchecksum;

  def.isValid = function isValid(id) {
    return _isValid(ndate, nrandom, nchecksum, id);
  };
  def.toDate = function toDate(id) {
    return _toDate(ndate, nrandom, nchecksum, epoc, id);
  };

  return def;
}
function createIdentity ( ndate , nrandom , nchecksum , epoc ) { var def = function identity ( ) { return _identity ( ndate , nrandom , nchecksum , epoc ) ; } ; def . EPOC = epoc ; def . dateLength = ndate ; def . randomLength = nrandom ; def . checksumLength = nchecksum ; def . size = ndate + nrandom + nchecksum ; def . isValid = function isValid ( id ) { return _isValid ( ndate , nrandom , nchecksum , id ) ; } ; def . toDate = function toDate ( id ) { return _toDate ( ndate , nrandom , nchecksum , epoc , id ) ; } ; return def ; }
Build a identity function by currying
@private
@param  {integer} ndate     Size of date bits
@param  {integer} nrandom   Size of random bits
@param  {integer} nchecksum Size of checksum bits
@param  {Date} epoc         Epoc to use
@return {Function}          A identity function
Build a identity function by currying