Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 3.15.22.202
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
unp-musonza /
node_modules /
dns-txt /
Delete
Unzip
Name
Size
Permission
Date
Action
.npmignore
13
B
-rw-r--r--
2015-11-08 20:06
.travis.yml
162
B
-rw-r--r--
2015-11-08 20:06
LICENSE
1.06
KB
-rw-r--r--
2015-11-08 20:06
README.md
2.74
KB
-rw-r--r--
2016-02-29 18:13
index.js
2.54
KB
-rw-r--r--
2016-04-24 14:42
package.json
1.63
KB
-rw-r--r--
2021-02-04 21:24
test.js
3.91
KB
-rw-r--r--
2016-04-24 14:43
Save
Rename
# dns-txt Encode or decode the RDATA field in multicast DNS TXT records. For use with DNS-Based Service Discovery. For details see [RFC 6763](https://tools.ietf.org/html/rfc6763). [](https://travis-ci.org/watson/dns-txt) [](https://github.com/feross/standard) [](https://github.com/mafintosh/abstract-encoding) ## Installation ``` npm install dns-txt ``` ## Usage ```js var txt = require('dns-txt')() var obj = { foo: 1, bar: 2 } var enc = txt.encode(obj) // <Buffer 05 66 6f 6f 3d 31 05 62 61 72 3d 32> txt.decode(enc) // { foo: '1', bar: '2' } ``` ## API The encoder and decoder conforms to [RFC 6763](https://tools.ietf.org/html/rfc6763). ### Initialize The module exposes a constructor function which can be called with an optional options object: ```js var txt = require('dns-txt')({ binary: true }) ``` The options are: - `binary` - If set to `true` all values will be returned as `Buffer` objects. The default behavior is to turn all values into strings. But according to the RFC the values can be any binary data. If you expect binary data, use this option. #### `txt.encode(obj, [buffer], [offset])` Takes a key/value object and returns a buffer with the encoded TXT record. If a buffer is passed as the second argument the object should be encoded into that buffer. Otherwise a new buffer should be allocated If an offset is passed as the third argument the object should be encoded at that byte offset. The byte offset defaults to `0`. This module does not actively validate the key/value pairs, but keep the following in rules in mind: - To be RFC compliant, each key should conform with the rules as specified in [section 6.4](https://tools.ietf.org/html/rfc6763#section-6.4). - To be RFC compliant, each value should conform with the rules as specified in [section 6.5](https://tools.ietf.org/html/rfc6763#section-6.5). After encoding `txt.encode.bytes` is set to the amount of bytes used to encode the object. #### `txt.decode(buffer, [offset], [length])` Takes a buffer and returns a decoded key/value object. If an offset is passed as the second argument the object should be decoded from that byte offset. The byte offset defaults to `0`. Note that all keys will be lowercased and all values will be Buffer objects. After decoding `txt.decode.bytes` is set to the amount of bytes used to decode the object. #### `txt.encodingLength(obj)` Takes a single key/value object and returns the number of bytes that the given object would require if encoded. ## License MIT