UNPKG

over-the-wire

Version:

Network inspection library for Node

5 lines (3 loc) 222 B
const macToString = buf => buf.toJSON().data.map(e => e.toString(16).padStart(2, '0')).join(':'); const macFromString = str => Buffer.from(str.replaceAll(':', ''), 'hex'); module.exports = { macToString, macFromString };