MacAddress

master

Mac address data type for Swift, also known as EUI-48.
haekelmeister/MacAddress

MacAddress

Implements MAC data type for Swift, also known as EUI-48. This code was influenced by abaumhauer/eui48

Installation

Swift Package Manager

Use swift package manager to install MacAddress by adding the proper description to your Package.swift file:

// swift-tools-version:5.1
import PackageDescription

let package = Package(
    name: "YOUR_PROJECT_NAME",
    dependencies: [
        .package(url: "https://github.com/haekelmeister/MacAddress.git", from: "1.0.3"),
    ]
)

Then run swift build to build your applicaton.

Usage

import MacAddress

let eui48_1 = MacAddress(withType: .broadcast)

print("eui48 = \(eui48_1.dotFormat)")

if let eui48_2 = MacAddress(fromString: "0x123456ABCDEF") {
    print("eui48 = \(eui48_2)")
}

References

Description

  • Swift Tools 5.1.0
View More Packages from this Author

Dependencies

  • None
Last updated: Wed Oct 23 2024 07:14:17 GMT-0900 (Hawaii-Aleutian Daylight Time)