Create helper functions for sha1-hashing strings. #694

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Jakub Filak <jfilak@redhat.com>