mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-12 01:01:32 -04:00
Improved ParseIPv6Address formatting
This commit is contained in:
parent
7af7b4df5e
commit
444065c926
2 changed files with 220 additions and 222 deletions
|
@ -403,7 +403,7 @@ export function strToIpv6(ipStr, retArr=true) {
|
|||
return ipStr;
|
||||
}
|
||||
let expandedStr = ipStr.substring(0, compactIndex); // 1234:5678::..
|
||||
const insertOffset = compactIndex == 0 ? 1 : 0;
|
||||
const insertOffset = compactIndex == 0;
|
||||
const ipEnd = ipStr.substring(compactIndex + 1);
|
||||
const missingChars = 39 - (expandedStr.length + ipEnd.length);
|
||||
for (let i = insertOffset; i < missingChars + insertOffset; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue