Yet another (un)interesting factlet:
Not only does the V6 address change at every boot, but its string changes length.
This is due to two things:
- Leading zeros are not printed, so some hextets have only three characters - or less. It doesn't seem to happen very often.
- Letters in the HEX groups are lowercase. which also varies the length.
Printing them all in uppercase is really easy:
curl -s http://icanhazip.com | tr '[a-z]' '[A-Z]'
This also improves readability.
Replacing leading blanks for zeros would be a bit more difficult. Not very, but at the moment I don't actually need a fixed-length string all that much.
Now, of course V4 addresses change length all the time, but they're short enough. V6 ones are longer than telephone wires ;·) and take up all possible horizontal space, so having them behave in an unruly way... messes up my lovely conky a bit :·)
And uppercase improves readability.
Not only does the V6 address change at every boot, but its string changes length.
This is due to two things:
- Leading zeros are not printed, so some hextets have only three characters - or less. It doesn't seem to happen very often.
- Letters in the HEX groups are lowercase. which also varies the length.
Printing them all in uppercase is really easy:
curl -s http://icanhazip.com | tr '[a-z]' '[A-Z]'
This also improves readability.
Replacing leading blanks for zeros would be a bit more difficult. Not very, but at the moment I don't actually need a fixed-length string all that much.
Now, of course V4 addresses change length all the time, but they're short enough. V6 ones are longer than telephone wires ;·) and take up all possible horizontal space, so having them behave in an unruly way... messes up my lovely conky a bit :·)
And uppercase improves readability.
Comment