📜 ⬆️ ⬇️

IPv6 PTR Converter

IPv6 is largely N.Y.H. (heretical crap is unknown, at least for me and millions of other Internet users). And the reverse IPv6 zones are N.Y.H. squared. Often you need to convert an IP address from direct to reverse format, that is, from the usual

2a12: 2666: 0000: 0001: 9b8: 1bf8: 6694: 3686 (address fictional)

something like this:
')
3.2.6.aed4.6.6.6.a.0.3.2.f.3 (the numbers in it are written in the reverse order, and the youngest hex digits of the IPv6 address)

To solve this problem, I wrote a program . At its entrance a text file of the form

2a22: 2666: 0000: 0001: a9b8: 1bf8: 6694: 3686 hot-babes-with-hot-skins.com.

and at the exit a fragment ready for insertion into the file of the reverse zone

3.2.6.aed4.6.6.6.a.0.3.2.f.3 PTR hot-babes-with-hot-skins.com.

(I truncate the first 20 characters of the IPv6 address, as they are indicated in the ORIGIN block header, this number can be changed
in the source;)

Yes, I completely forgot to say, when encoding the algorithm, I used the style “programming without using the brain” that I recently invented

Source: https://habr.com/ru/post/186832/


All Articles