public bool DetectSsl(Ip7Address address) { var abas = address.Parts.Where(part => !part.IsHypernet).SelectMany(part => this.FindAbas(part.Characters)); var babs = address.Parts.Where(part => part.IsHypernet).SelectMany(part => this.FindAbas(part.Characters)); var desiredBabs = abas.Select(aba => $"{aba[1]}{aba[0]}{aba[1]}"); return(babs.Intersect(desiredBabs).Any()); }
public bool DetectTls(Ip7Address address) { bool abbaInNormal = false, abbaInHypernet = false; foreach (var seq in address.Parts) { if (seq.IsHypernet) { abbaInHypernet = abbaInHypernet || this.ContainsAbba(seq.Characters); } else { abbaInNormal = abbaInNormal || this.ContainsAbba(seq.Characters); } } return(abbaInNormal && !abbaInHypernet); }
protected bool Equals(Ip7Address other) { return(this.Parts.SequenceEqual(other.Parts)); }