Closed texasRanger09 closed 9 months ago
Uses this algorithm to convert the peerKey byte array
func convertData(_ data: Data) -> String {
let hash = Insecure.MD5.hash(data: data)
return hash.map { String(format: "%02hhx", $0) }.joined()
}
This same algorithm should be used in the Android version in order to keep the peerKeys comparable.
Good job finding the peerKey hashing algorithm! I suggest we create an extension on DittoPeer in a dedicated file in the PeersList module that vends a public var peerKeyString: String
The connected peer peerKey hash is wrong in the PeersListView in the local peer view. Please see my fix PR which should merge to Walker's/this PR, not to main.
updates the peers list to use the the peerKey instead of the addressSiteId. The peerKey is a unique identifier to each device and will allow for identifying a device in the logs with the peerKey.