[fix] sort metadata keys before creating hash