DEV Community

Samandar Ravshanov
Samandar Ravshanov

Posted on

📦 RDATA field encoder/decoder in multicast DNS TXT records

from functorflow import ff

data = {'zero': 0, 'one': 1}
r = ff('dns-txt').encode(data)
print(r)
# {'type': 'Buffer', 'data': [6, 122,..]}

r = ff('dns-txt').decode(r)
print(r) # {'zero': '0', 'one': '1'}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)