code: function xuid () {
    var now = Date.now()
    var date = encode(now).slice(-7)
    var random = ('000' + encode(counter)).slice(-3) +
      encode(parseInt(randomBytes(6).toString('hex'), 16)).slice(-4)
  
    if (arguments.length > 0) {
      date = encode(arguments[0]).slice(-7)
    }
  
    if (arguments.length > 1) {
      random = ('0000000' + encode(arguments[1])).slice(-7)
    }
  
    if (now !== time && counter > max / 2) {
      counter = parseInt(randomBytes(2).toString('hex'), 16)
    } else {
      counter += 1
    }
  
    time = now
  
    return date + random
  }
docs: [0-6: date, 7-9: counter, 10-13: random]