Python Generate Hash From String