You are given a string and a number(sub-string length). the string consists of *, -, and + characters, and the string's length will be the multiple of the given number. Write a function to hash the string using the below hashing algorithm:
- Split the given string into multiple sub-strings of a given length starting from left
- Calculate the weight of each sub-string. The number of times a unique sub-string value appears after splitting is defined as the weight of that sub-string
- Sort the unique sub-string values by weight in descending order. If 2 or more sub-strings have the same weight, then sort them by character order: * > - > +
- Create the hash by concatenating the sorted list of unique sub-strings and return the hash.