Fix Java Conversion Routine for IPv6 Address to BigInteger

I have a routine to convert an IPv6 address to a BigInteger. It works fine except when the "::" is at the end of the IPv6 address. For example, 2001:4888:3D:FF00:362:D::

Routine is below. I will pay a maximum of $15 for the fix.

public BigInteger ipv6ToNumber(String addr) {

int startIndex=[url removed, login to view]("::");


String firstStr=[url removed, login to view](0,startIndex);

String secondStr=[url removed, login to view](startIndex+2, [url removed, login to view]());

BigInteger first=ipv6ToNumber(firstStr);

int x=countChar(addr, ':');

first=[url removed, login to view](16*(7-x)).add(ipv6ToNumber(secondStr));

return first;


String[] strArr = [url removed, login to view](":");

BigInteger retValue = [url removed, login to view](0);

for (int i=0;i<[url removed, login to view];i++) {

BigInteger bi=new BigInteger(strArr[i], 16);

retValue = [url removed, login to view](16).add(bi);


return retValue;


Compétences : Ingénierie, Java, JSP, Architecture Logicielle, Tests de Logiciels

Voir plus : substring c, substring 0 2, int i, c substring, c string substring, c for int, java mac swing fix, java video player fix, java script download fix, java ie6 png fix, quick fix fix log viewer, java conversion code, spreadsheet java conversion bid, php java conversion, jar java conversion, java conversion

Concernant l'employeur :
( 302 commentaires ) Carmel Valley, United States

N° du projet : #8468459

Décerné à :


A proposal has not yet been provided

25 $ USD en 1 jour
(73 Commentaires)

2 freelance font une offre moyenne de $23 pour ce travail


A proposal has not yet been provided

29 $ USD en 1 jour
(51 Commentaires)

A proposal has not yet been provided

20 $ USD en 0 jours
(36 Commentaires)

A proposal has not yet been provided

421 $ USD en 1 jour
(1 Commentaire)