[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 Name Job ID Coverage
  Build
passed build_linux_36 #178265
docker

00:04:07

73.0%
passed build_linux_37 #178266
docker

00:04:48

73.0%
passed build_macosx_36 #178263
macosx

00:03:42

73.0%
passed build_macosx_37 #178264
macosx

00:04:08

73.0%