Automatically deduce type for key hash