Fix #4458 : now sha1 result_str() return correct value

Fix is a bug fix for issue #4458.

This patch is quite straight-forward. A test for result_str() is added.