Improve SHA of stdin to handle newlines