public static EncryptionTypes Adapt(MonoTorrent.Client.Encryption.EncryptionTypes type) { EncryptionTypes t = EncryptionTypes.None; if (Has(MonoTorrent.Client.Encryption.EncryptionTypes.PlainText, type)) { t |= EncryptionTypes.PlainText; } if (Has(MonoTorrent.Client.Encryption.EncryptionTypes.RC4Full, type)) { t |= EncryptionTypes.RC4Full; } if (Has(MonoTorrent.Client.Encryption.EncryptionTypes.RC4Header, type)) { t |= EncryptionTypes.RC4Header; } return(t); }
private static bool Has(MonoTorrent.Client.Encryption.EncryptionTypes wanted, MonoTorrent.Client.Encryption.EncryptionTypes actual) { return((wanted & actual) == wanted); }