export const stringHash = ( str ) : number => { let hash = 0 , i , chr ; for ( i = 0 ; i < str . length ; i ++ ) { chr = str . charCodeAt ( i ) ; hash = ( hash << 5 ) - hash + chr ; hash |= 0 ; } return hash ; } ;