[utils] Fix hash generated by storage classes

The hash doesn't match what is done in beat/beat.web> resulting
in a mismatch when using e.g. beat/beat.cmdline>.

This patch modifies the code so that the returned value
follows the same logic as used in beat/beat.web>
4 jobs for fix_asset_hash_generation in 4 minutes and 49 seconds (queued for 2 seconds)
Status Job ID Name Coverage
  Build
passed #178265
docker
build_linux_36

00:04:07

73.0%
passed #178266
docker
build_linux_37

00:04:48

73.0%
passed #178263
macosx
build_macosx_36

00:03:42

73.0%
passed #178264
macosx
build_macosx_37

00:04:08

73.0%