util: add find_zero_blocks()

This adds a helper function which does the similar thing as
trim_zero_blocks() but doesn't update the given buffer.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
add sha1_from_buffer()

This adds a helper function to calculate a unique sha1 digest based on
the given buffer.

This also fixes a bug that we don't use an original buffer length to
calculate the hash value and the result is not unique.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>