Added Mac.toLong(string)

connection_type_change
nathan 2020-08-09 14:50:35 +02:00
parent 27a90021a7
commit b7d62e4242
1 changed files with 4 additions and 0 deletions

View File

@ -300,6 +300,10 @@ object Mac {
return BigInteger(s, 16).toByteArray()
}
fun toLong(mac: String): Long {
return toLong(mac, MacDelimiter.COLON)
}
fun toLong(mac: ByteArray): Long {
return ((mac[5].toLong() and 0xff)
+ (mac[4].toLong() and 0xff shl 8)