mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 16:05:20 +00:00
8 byte peer ID
This commit is contained in:
@@ -626,10 +626,10 @@ class BluetoothMeshService(private val context: Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate peer ID compatible with iOS
|
* Generate peer ID compatible with iOS - exactly 8 bytes (16 hex characters)
|
||||||
*/
|
*/
|
||||||
private fun generateCompatiblePeerID(): String {
|
private fun generateCompatiblePeerID(): String {
|
||||||
val randomBytes = ByteArray(4)
|
val randomBytes = ByteArray(8) // 8 bytes = 16 hex characters (like iOS)
|
||||||
Random.nextBytes(randomBytes)
|
Random.nextBytes(randomBytes)
|
||||||
return randomBytes.joinToString("") { "%02x".format(it) }
|
return randomBytes.joinToString("") { "%02x".format(it) }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user