Because the used methods of the BigInteger changes a global variable.
BigInteger.Hex;
BigInteger.Decimal;
But I was looking, it is possible to avoid these methods, so this new example will be safe:
uses
System.SysUtils, Velthuis.BigIntegers;
function IPV6ToNumberDigits(const AIPV6: string): string;
var
LBigInteger: BigInteger;
begin
if not BigInteger.TryParse(AIPV6.Replace(':', '', [rfReplaceAll]), 16, LBigInteger) then
Exit('');
Result := LBigInteger.ToString;
end;
function NumberDigitsToIPV6(const ANumberDigits: string): string;
var
I: Integer;
begin
if ANumberDigits.IsEmpty then
Exit('');
Result := BigInteger(ANumberDigits).ToHexString.ToLower.PadLeft(32, '0');
for I := 0 to 6 do
Result := Result.Insert((4 * (I+1)) + I, ':');
end;