Write hash value as hex string