Shared logic for various address types.
|
bytes_to_bits()
Returns:
A 256 element list containing 8-bit binary digit strings. |
|
|
|
valid_words(words,
word_size,
num_words)
Returns:
True if word sequence is valid for this address type,
False otherwise. |
|
|
|
int_to_words(int_val,
word_size,
num_words)
Returns:
A tuple contain unsigned integer word values split according to
provided arguments. |
|
|
|
words_to_int(words,
word_size,
num_words)
Returns:
An unsigned integer that is equivalent to value represented by word
sequence. |
|
|
|
valid_bits(bits,
width,
word_sep='
' )
Returns:
True if network address is valid, False
otherwise. |
|
|
|
bits_to_int(bits,
width,
word_sep='
' )
Returns:
An unsigned integer that is equivalent to value represented by
network address in readable binary form. |
|
|
|
int_to_bits(int_val,
word_size,
num_words,
word_sep='
' )
Returns:
A network address in a delimited binary string format that is
equivalent in value to unsigned integer. |
|
|
|
valid_bin(bin_val,
width)
Returns:
True if network address is valid, False
otherwise. |
|
|
|
int_to_bin(int_val,
width)
Returns:
Equivalent string value in Python's binary representation format
('0bxxx'). |
|
|
|
bin_to_int(bin_val,
width)
Returns:
An unsigned integer that is equivalent to value represented by Python
binary string format. |
|
|