mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-09 15:55:01 -04:00
Update IP.mjs
This commit is contained in:
parent
c9504ac675
commit
67886c886d
1 changed files with 1 additions and 4 deletions
|
@ -352,10 +352,7 @@ export function ipv4ToStr(ipInt) {
|
||||||
export function strToIpv6(ipStr, retArr=true) {
|
export function strToIpv6(ipStr, retArr=true) {
|
||||||
if (retArr === false) {
|
if (retArr === false) {
|
||||||
// TODO: Expand address.
|
// TODO: Expand address.
|
||||||
if (ipStr.length % 2 === 1) {
|
return Number("0x" + ipStr.replace(/\:/g, ''));
|
||||||
ipStr = "0" + ipStr;
|
|
||||||
}
|
|
||||||
return Number("0x" + ipStr.replace(":", ""));
|
|
||||||
}
|
}
|
||||||
let j = 0;
|
let j = 0;
|
||||||
const blocks = ipStr.split(":"),
|
const blocks = ipStr.split(":"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue