return whether two buffers are equal