mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 20:05:21 +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 {
|
||||
val randomBytes = ByteArray(4)
|
||||
val randomBytes = ByteArray(8) // 8 bytes = 16 hex characters (like iOS)
|
||||
Random.nextBytes(randomBytes)
|
||||
return randomBytes.joinToString("") { "%02x".format(it) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user