UNPKG
over-the-wire
Version:
latest (1.2.3)
1.2.3
1.1.3
1.0.3
1.0.2
1.0.1
1.0.0
Network inspection library for Node
github.com/vaguue/over-the-wire
vaguue/over-the-wire
over-the-wire
/
lib
/
layers
/
mac.js
5 lines
(3 loc)
•
222 B
JavaScript
View Raw
1
2
3
4
5
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 };