refactor basic
WIP
This commit is contained in:
35 files changed
+544
-637
No files matched your search
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright © 2025 RTAkland
|
||||
* Author: RTAkland
|
||||
* Date: 9/29/25
|
||||
*/
|
||||
|
||||
|
||||
package cn.rtast.nmdns.util
|
||||
|
||||
import kotlin.experimental.ExperimentalNativeApi
|
||||
import kotlin.random.Random
|
||||
|
||||
/**
|
||||
* generate random mac address
|
||||
*/
|
||||
@OptIn(ExperimentalNativeApi::class)
|
||||
public fun randomMacAddress(): String {
|
||||
val bytes = ByteArray(6) { Random.nextInt(0, 256).toByte() }
|
||||
return bytes.joinToString(":") { it.toHexString() }
|
||||
}
|
||||
Reference in New Issue
Block a user