public override int GetHashCode() { if (LabelAsString != null) { return(LabelAsString.GetHashCode()); } return(LabelAsInt32.GetHashCode()); }
/// <summary> /// Returns the hash code for this instance. /// </summary> /// <returns>A 32-bit signed integer hash code.</returns> public override int GetHashCode() { // Since this type is used as a key in a dictionary (see CoseHeaderMap) // and since the label is potentially adversary-provided, we'll need // to randomize the hash code. if (LabelAsString != null) { return(LabelAsString.GetRandomizedOrdinalHashCode()); } return(LabelAsInt32.GetRandomizedHashCode()); }