UNPKG
node-mndp
Version:
latest (0.0.3)
0.0.3
0.0.2
0.0.1
A Mikrotik Network Discovery Protocol in Node
github.com/pheinrichs/node-mndp
pheinrichs/node-mndp
node-mndp
/
lib
/
util
/
format.ts
9 lines
(8 loc)
•
287 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
export
function
buf2hex
(
buffer
:
Uint8Array
):
string
{
return
Array
.
prototype
.
map
.
call
(
new
Uint8Array
(buffer),
(
x
:
any
) =>
(
'00'
+ x.
toString
(
16
)).
slice
(-
2
)).
join
(
''
); }
export
function
bin2String
(
buffer
:
Uint8Array
):
string
{
return
String
.
fromCharCode
.
apply
(
String
, buffer); }