Secure practice in truncating cryptographic hash