Converts string to hash