Challenge
Write a program or function that converts a 32 bit binary number to its quad-dotted decimal notation (often used for representing IPv4)
Quad-dotted decimal
A quad-dotted decimal is formed like so:
- Split the binary representation into its 4 individual bytes
- Convert each byte into denary
- place "." between each number
Example:
input: 10001011111100010111110001111110
step 1: 10001011 11110001 01111100 01111110
step 2: 139 241 124 126
step 3: 139.241.124.126
I/O examples
input --> output
10001011111100010111110001111110 --> 139.241.124.126
00000000000000000000000000000000 --> 0.0.0.0
01111111000000000000000000000001 --> 127.0.0.1
11000000101010000000000111111111 --> 192.168.1.255
Rules
- Input will always be a 32 bit binary number or a binary list or string
- Standard I/O rules apply
- No standard loopholes
- This is code-golf, so the shortest answer in bytes wins
127.0.0.1
? \$\endgroup\$