lib/identity.js
function _isValid (ndate, nrandom, nchecksum, id) {
  // Guard
  if (!baseURL.isValid(id)) return false;
  if (id.length !== (ndate + nrandom + nchecksum) / 6) return false;

  // Test
  var bits = baseURL.decode(id),
    main = bits.slice(0, bits.length - nchecksum),
    check = bits.slice(bits.length - nchecksum, bits.length);

  return bitString.checksum(main, nchecksum) === check;
}
function _isValid (ndate, nrandom, nchecksum, id) {
  // Guard
  if (!baseURL.isValid(id)) return false;
  if (id.length !== (ndate + nrandom + nchecksum) / 6) return false;

  // Test
  var bits = baseURL.decode(id),
    main = bits.slice(0, bits.length - nchecksum),
    check = bits.slice(bits.length - nchecksum, bits.length);

  return bitString.checksum(main, nchecksum) === check;
}
function _isValid ( ndate , nrandom , nchecksum , id ) { // Guard if ( ! baseURL . isValid ( id ) ) return false ; if ( id . length !== ( ndate + nrandom + nchecksum ) / 6 ) return false ; // Test var bits = baseURL . decode ( id ) , main = bits . slice ( 0 , bits . length - nchecksum ) , check = bits . slice ( bits . length - nchecksum , bits . length ) ; return bitString . checksum ( main , nchecksum ) === check ; }
Check if a id is valid
@private
@param  {integer} ndate     Size of date bits
@param  {integer} nrandom   Size of random bits
@param  {integer} nchecksum Size of checksum bits
@param  {string}  id        BaseURL encoded Id to test
@return {Boolean}           [description]
Check if a id is valid