def METHOD_NAME(rootNode):
    if rootNode.is_file():
        return rootNode.bytehash
    h = hashlib.new(HASH_ALGORITHM)
    for child in rootNode.children:
        if child.is_file():
            h.update(child.bytehash)
        else:
            h.update(METHOD_NAME(child))
    rootNode.bytehash = h.digest()
    rootNode.hexdigest_hash = h.hexdigest()
    return h.digest()