fixed a bug in SHA calculation in streaming