hashfunction for char ptr