code: function _escape(inp) {
    var esc = '';
    var i;
    if (typeof (inp) === 'string') {
      for (i = 0; i < inp.length; i++) {
        switch (inp[i]) {
          case '*':
            esc += '\\2a';
            break;
          case '(':
            esc += '\\28';
            break;
          case ')':
            esc += '\\29';
            break;
          case '\\':
            esc += '\\5c';
            break;
          case '\0':
            esc += '\\00';
            break;
          default:
            esc += inp[i];
            break;
        }
      }
      return esc;
  
    } else {
      assert.buffer(inp, 'input must be string or Buffer');
      for (i = 0; i < inp.length; i++) {
        if (inp[i] < 16) {
          esc += '\\0' + inp[i].toString(16);
        } else {
          esc += '\\' + inp[i].toString(16);
        }
      }
      return esc;
    }
  }
docs: /--- API 
  RFC 2254 Escaping of filter strings
  
  Raw                     Escaped
  (o=Parens (R Us))       (o=Parens \28R Us\29)
  (cn=star*)              (cn=star\2A)
  (filename=C:\MyFile)    (filename=C:\5cMyFile)
  
  Use substr_filter to avoid having * ecsaped.
  
  @author [Austin King](https://github.com/ozten)