Repository navigation
Commit fd0687e
fix: pad Address6#toByteArray to a full 16 bytes
`bigInt().toString(16)` drops high-order zero nibbles, so `toByteArray()`
and `toUnsignedByteArray()` returned a short array for any address with
leading zero bytes. `::1` yielded `[1]` and `::` yielded `[0]` instead of
the documented 16-byte representation, which breaks `Buffer.from(...)` for
fixed-width network and storage use.
Pad the hex string to `BITS / 4` nibbles (16 bytes), matching the existing
`binaryZeroPad()` approach and the `Address4#toArray` sibling, which
already returns a fixed-width array.1 parent c697eaa commit fd0687e
3 files changed
Lines changed: 25 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1122 | 1122 | | |
1123 | 1123 | | |
1124 | 1124 | | |
1125 | | - | |
1126 | | - | |
1127 | | - | |
1128 | | - | |
| 1125 | + | |
1129 | 1126 | | |
1130 | 1127 | | |
1131 | 1128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1515 | 1515 | | |
1516 | 1516 | | |
1517 | 1517 | | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
1518 | 1540 | | |
0 commit comments