@mi-sec/mac-address
v1.0.16
Published
MAC Address utility
Downloads
35
Readme
@mi-sec/mac-address
MAC Address utility for parsing and validating MAC Addresses
- Cross-platform - Support for:
- CommonJS, ECMAScript Modules and UMD builds
- Node >= 13.2.x (8, 10, 12 in progress)
Usage
import macAddress from '@mi-sec/mac-address';
macAddress( '12:34:56:78:90:AB' ) -> <Buffer 12 34 56 78 90 ab>
macAddress( '12-34-56-78-90-AB' ) -> <Buffer 12 34 56 78 90 ab>
macAddress( '1234567890AB' ) -> <Buffer 12 34 56 78 90 ab>
macAddress( 0x1234567890AB ) -> <Buffer 12 34 56 78 90 ab>
macAddress( 20015998341291 ) -> <Buffer 12 34 56 78 90 ab>
import { isValidMACAddress } from '@mi-sec/mac-address';
isValidMACAddress( '12:34:56:78:90:AB' ) -> true
isValidMACAddress( '1234567890ZZ' ) -> false