Skip to content

Commit 6df9e6e

Browse files
authored
fix: MacAddress parse from octets to string correctly (#146)
MacAddresses does not repeat itself
1 parent 2ed0a09 commit 6df9e6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/packets/ethernet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class MacAddress {
3434
// Turn to string
3535
toString(): string {
3636
return Array.from(this.octets)
37-
.map((d) => d.toString(16))
37+
.map((byte) => byte.toString(16).padStart(2, "0"))
3838
.join(":");
3939
}
4040

0 commit comments

Comments
 (0)