Example code for IPv6 to uint128 code:
#include "..\include\BigNum.au3"
Local $sIPv6 = "2001: 4860: 4860 :: 8888"
; there shouldn't be spaces and add trailing column
$sIPv6 = StringReplace($sIPv6, ' ', '') & ':'
; split string on columns
Local $aIPv6 = StringRegExp($sIPv6, "([[:xdigit:]]{0,4}):", 3)
; expand double columns to strings of zeroes
; and store hex values in structure uword elements
Local $tIPv6_16 = DllStructCreate("ushort[8]")
Local $tIPv6_64 = DllStructCreate("uint64[2]", DllStructGetPtr($tIPv6_16))
For $i = 0 To 7
If $aIPv6[$i] == "" Then
$aIPv6[$i] = "0"
For $j = 0 To 7 - UBound($aIPv6)
_ArrayInsert($aIPv6, $i + 1 + $j, "0")
Next
EndIf
DllStructSetData($tIPv6_16, 1, Number("0x" & $aIPv6[$i]), 8 - $i)
Next
; fetch hi and lo uint64 values
Local $iHi64 = _UintToString(DllStructGetData($tIPv6_64, 1, 2), 10)
Local $iLo64 = _UintToString(DllStructGetData($tIPv6_64, 1, 1), 10)
; shift left hi value by 64 bits
ConsoleWrite(_bignum_parse($iHi64 & " * 18446744073709551616 + " & $iLo64) & @LF)
Func _UintToString($i, $base)
Return DllCall("msvcrt.dll", "wstr:cdecl", "_ui64tow", "uint64", $i, "wstr", "", "int", $base)[0]
Return $aRes[0]
EndFunc ;==>_UintToString
The reverse conversion left as exercise to readers.