-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathEncryptionOptions.cs
More file actions
75 lines (64 loc) · 2.31 KB
/
Copy pathEncryptionOptions.cs
File metadata and controls
75 lines (64 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
using System;
using System.Collections.Generic;
using System.Text;
namespace QIQI.EProjectFile.Encryption
{
public abstract class EplEncryptionOptions
{
public sealed class EStd : EplEncryptionOptions, IEquatable<EStd>
{
public EplSecret.EStd Password;
public override bool Equals(object obj)
{
return Equals(obj as EStd);
}
public bool Equals(EStd other)
{
return !(other is null) &&
EqualityComparer<EplSecret.EStd>.Default.Equals(Password, other.Password);
}
public override int GetHashCode()
{
return -1081153288 + EqualityComparer<EplSecret.EStd>.Default.GetHashCode(Password);
}
public static bool operator ==(EStd left, EStd right)
{
return EqualityComparer<EStd>.Default.Equals(left, right);
}
public static bool operator !=(EStd left, EStd right)
{
return !(left == right);
}
}
public sealed class EC : EplEncryptionOptions, IEquatable<EC>
{
public EplSecret.EC Password;
public string PasswordHint;
public override bool Equals(object obj)
{
return Equals(obj as EC);
}
public bool Equals(EC other)
{
return !(other is null) &&
EqualityComparer<EplSecret.EC>.Default.Equals(Password, other.Password) &&
PasswordHint == other.PasswordHint;
}
public override int GetHashCode()
{
int hashCode = 1281113049;
hashCode = hashCode * -1521134295 + EqualityComparer<EplSecret.EC>.Default.GetHashCode(Password);
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(PasswordHint);
return hashCode;
}
public static bool operator ==(EC left, EC right)
{
return EqualityComparer<EC>.Default.Equals(left, right);
}
public static bool operator !=(EC left, EC right)
{
return !(left == right);
}
}
}
}