PeerID 22/n: PrivateChatManager (#800)

* PrivateChatManager: functions to use `PeerID`

* PrivateChatManager: properties to use `PeerID`
This commit is contained in:
Islam
2025-10-14 12:30:18 +02:00
committed by GitHub
parent ad4103bacc
commit 23249f3e41
6 changed files with 150 additions and 133 deletions
+6 -1
View File
@@ -161,9 +161,14 @@ extension PeerID {
id.rangeOfCharacter(from: validCharset.inverted) == nil
}
/// Returns true if the `bare` id is all hex
var isHex: Bool {
bare.allSatisfy { $0.isHexDigit }
}
/// Short routing IDs (exact 16-hex)
var isShort: Bool {
bare.count == Constants.hexIDLength && Data(hexString: bare) != nil
bare.count == Constants.hexIDLength && isHex
}
/// Full Noise key hex (exact 64-hex)