Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videostreaming/polycentricandroid
1 result
Show changes
Commits on Source (1)
......@@ -474,6 +474,22 @@ class ProcessSecret(val system: KeyPair, val process: Process) {
return ProcessHandle(this, system.publicKey)
}
override fun hashCode(): Int {
return combineHashCodes(listOf(system.hashCode(), process.hashCode()))
}
override fun toString(): String {
return "(system: $system, process: $process)"
}
override fun equals(other: Any?): Boolean {
if (other !is ProcessSecret) {
return false
}
return system == other.system && process == other.process
}
companion object {
fun fromProto(proto: Protocol.StorageTypeProcessSecret): ProcessSecret {
if (!proto.hasSystem()) {
......@@ -590,6 +606,18 @@ data class KeyPair(val privateKey: PrivateKey, val publicKey: PublicKey) {
return "(privateKey: $privateKey, publicKey: $publicKey)"
}
override fun hashCode(): Int {
return combineHashCodes(listOf(privateKey.hashCode(), publicKey.hashCode()))
}
override fun equals(other: Any?): Boolean {
if (other !is KeyPair) {
return false
}
return privateKey == other.privateKey && publicKey == other.publicKey
}
companion object {
fun fromProto(proto: Protocol.KeyPair): KeyPair {
return KeyPair(
......