@gidw/mac-address-util
v1.0.3
Published
Utility functions for working with MAC addresses
Downloads
232
Readme
MAC address utilities
Utility functions to transform a MAC address to string representation and number representation.
Usage
var macAddressUtil = require('@gidw/mac-address-util')
// Returns "88:77:66:55:44:33"
macAddressUtil.convertToMac(150046399349811)
// Returns "45:67:89:ab:cd:ef"
macAddressUtil.convertToMac(76310993685999)
// Returns ""
macAddressUtil.convertToMac(-1)
// Returns 150046399349811
macAddressUtil.convertToNumber('88:77:66:55:44:33')
// Returns 76310993685999
macAddressUtil.convertToNumber('45-67-89-AB-cd-Ef')
// Returns 0
macAddressUtil.convertToNumber('abc')