calculates the frequency of bytes in a file