How to use the bns.wire.types function in bns

To help you get started, we’ve selected a few bns examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github handshake-org / hsd / lib / dns / records.js View on Github external
static isPointer(name, type) {
    if (type != null
        && type !== wire.types.ANY
        && type !== wire.types.A
        && type !== wire.types.AAAA) {
      return false;
    }

    if (name.length < 2 || name.length > 29)
      return false;

    if (name[0] !== '_')
      return false;

    return base32.testHex(name.substring(1));
  }
github handshake-org / hsd / lib / dns / records.js View on Github external
matches(type) {
    switch (type) {
      case wire.types.ANY:
        return true;
      case wire.types.A:
        return this.isINET4();
      case wire.types.AAAA:
        return this.isINET6();
      default:
        return false;
    }
  }