utils: Fix hash generation code

Signed-off-by: Michal Novotny <mignov@gmail.com>