how to measure the hardness of a material