Extract hash calcs into hex_val().