[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>