diff options
Diffstat (limited to 'netlib/utils.py')
-rw-r--r-- | netlib/utils.py | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/netlib/utils.py b/netlib/utils.py index 779eaa27..7b007cb5 100644 --- a/netlib/utils.py +++ b/netlib/utils.py @@ -1,21 +1,5 @@ import re - -def setbit(byte, offset, value): - """ - Set a bit in a byte to 1 if value is truthy, 0 if not. - """ - if value: - return byte | (1 << offset) - else: - return byte & ~(1 << offset) - - -def getbit(byte, offset): - mask = 1 << offset - return bool(byte & mask) - - _label_valid = re.compile(b"(?!-)[A-Z\d-]{1,63}(?<!-)$", re.IGNORECASE) |