qaz@lemmy.world to Programmer Humor@programming.devEnglish · 2 days agoWe don't talk about IPv5lemmy.worldexternal-linkmessage-square190fedilinkarrow-up1931arrow-down131
arrow-up1900arrow-down1external-linkWe don't talk about IPv5lemmy.worldqaz@lemmy.world to Programmer Humor@programming.devEnglish · 2 days agomessage-square190fedilink
minus-squarepanda_abyss@lemmy.calinkfedilinkarrow-up10arrow-down5·2 days agoI wrote and ipv6 parser once. Never again.
minus-squareXylight@lemdro.idlinkfedilinkEnglisharrow-up5·2 days agoAs in a regex or …? An ipv4 parser would also be sorta difficult. you have to account for the fact that all the octets can be added to decimal: http://2130706433 (valid 127.0.0.1) or the fact that octets can be in different formats: http://0x7F.0x0.0x0.0x1 (127.0.0.1) or the fact that you can mix octet formats: http://0xC0.0250.0.1 (192.168.0.1)
minus-squarepanda_abyss@lemmy.calinkfedilinkarrow-up1·2 days agoYeah a mix of regex and heuristics to validate before parsing It was a long time ago now It also had to parse ipv4 because they can be embedded (IIRC) and the different octet formats
I wrote and ipv6 parser once.
Never again.
As in a regex or …?
An ipv4 parser would also be sorta difficult.
you have to account for the fact that all the octets can be added to decimal: http://2130706433 (valid 127.0.0.1)
or the fact that octets can be in different formats: http://0x7F.0x0.0x0.0x1 (127.0.0.1)
or the fact that you can mix octet formats: http://0xC0.0250.0.1 (192.168.0.1)
Yeah a mix of regex and heuristics to validate before parsing
It was a long time ago now
It also had to parse ipv4 because they can be embedded (IIRC) and the different octet formats