How do I use javascript to compare the size of the starting ip and ending ip of the ipv6 format?

1, node environment?
2, non-node environment?
because the actual work is jquery+bootstrap, it is best to implement a pure js
3, please consider:: case, 0234 omitted from 234, etc.

Aug.09,2021

IPV6 is made up of four-digit hexadecimal numbers, which is actually numeric.

parseInt("AAAA",16)
43690

first segment the IP.
for example:


ASCII

const ipv6 = 'CDCD:910A:2222:5498:8475:1111:3900:2020'
let blocks = ipv6.toUpperCase().split(':')
console.log(a[0] > a[7])

there is no need to distinguish between js running environments

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3f057-2c450.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3f057-2c450.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?