Skip to content
Snippets Groups Projects
Commit ce7fb647 authored by MyIgel's avatar MyIgel :fire: Committed by skorpy
Browse files

Added RFC 3397 encoding for kea

parent 54786faa
No related branches found
No related tags found
1 merge request!387Added RFC 3397 encoding for kea
def rfc3397(domains):
"""
Return a RFC-3397 encoded string (without compression)
see https://tools.ietf.org/search/rfc3397
:param string[] domains: A list of domains
"""
domain_list = ""
for domain in domains:
domain_list += ''.join(
map(lambda dom: chr(len(dom)) + dom, domain.strip().split('.'))
) + "\0"
return domain_list.encode('utf-8').hex()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment