def int_to_words(int_val, word_size, num_words):
    max_int = 2 ** (num_words * word_size) - 1

    if not 0 <= int_val <= max_int:
        raise IndexError('integer out of bounds: %r!' % hex(int_val))

    max_word = 2 ** word_size - 1

    words = []
    for _ in range(num_words):
        word = int_val & max_word
        words.append(int(word))
        int_val >>= word_size

    return tuple(reversed(words))
Flush `data` to a chunk.
dataset/ETHPy150Open drkjam/netaddr/netaddr/strategy/__init__.py/int_to_words--crossover with--dataset/ETHPy150Open twisted/txmongo/txmongo/_gridfs/grid_file.py/GridIn.__flush_data