Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
noc
noc
Commits
433cefa1
Verified
Commit
433cefa1
authored
Sep 25, 2021
by
Andrey Vertiprahov
Browse files
Generation reverse IPv6 DNS zone with hex characters
parent
61f8f933
Pipeline
#33589
passed with stages
in 24 minutes and 25 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
core/dns/rr.py
View file @
433cefa1
# ----------------------------------------------------------------------
# RR helper class
# ----------------------------------------------------------------------
# Copyright (C) 2007-202
0
The NOC Project
# Copyright (C) 2007-202
1
The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# python modules
import
string
# NOC modules
from
.encoding
import
to_idna
...
...
@@ -96,4 +99,9 @@ class RR(object):
try
:
return
int
(
v
)
except
ValueError
:
return
v
return
int
(
v
,
base
=
16
)
if
RR
.
is_hex
(
v
)
else
v
@
staticmethod
def
is_hex
(
s
):
hex_digits
=
set
(
string
.
hexdigits
)
return
all
(
c
in
hex_digits
for
c
in
s
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment