INNER CODE UNIT · Python

ttl_avg

A3sal0n/CyberThreatHunting · tools/bro-dns-iforest.py:32

def ttl_avg(ttls):
    sum = 0
    for ttl in ttls:
        sum += ttl
    return sum/len(ttls)


def string_encode(data):
    alphabet = '0123456789abcdefghijklmnopqrstuvwxyz.: '
    char_to_int = dict((c, i) for i, c in enumerate(alphabet))
    integer_encoded = [char_to_int[char.decode("ascii")] for char in data]
    encoded = ""
    for n in integer_encoded:
        encoded += str(n)
    return int(encoded)


def entropy(s):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…