Closed avasant21 closed 2 years ago
@whitequark can you publish this change on npm? thanks
Done as 2.1.0
unfortunately on npm it is still 2.0.1 i guess you still need to publish?
Yeah I forgot. Seems like publishing is broken now:
npm notice
npm notice 📦 ipaddr.js@2.1.0
npm notice === Tarball Contents ===
npm notice 1.1kB LICENSE
npm notice 34.3kB lib/ipaddr.js
npm notice 11.9kB ipaddr.min.js
npm notice 857B package.json
npm notice 694B Changes.md
npm notice 8.5kB README.md
npm notice 2.9kB lib/ipaddr.js.d.ts
npm notice === Tarball Details ===
npm notice name: ipaddr.js
npm notice version: 2.1.0
npm notice package size: 15.2 kB
npm notice unpacked size: 60.2 kB
npm notice shasum: 2119bc447ff8c257753b196fc5f1ce08a4cdf39f
npm notice integrity: sha512-LlbxQ7xKzfBus[...]xtAVu9T3OelJQ==
npm notice total files: 7
npm notice
npm ERR! code E404
npm ERR! 404 Not Found - PUT https://registry.npmjs.org/ipaddr.js - Not found
npm ERR! 404
npm ERR! 404 'ipaddr.js@2.1.0' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/whitequark/.npm/_logs/2023-05-30T14_35_42_136Z-debug.log
Oh, it's because they started requiring OTPs and didn't do error messages well. Published now.
the below toString() operation is wrong.
rfc5952: https://www.rfc-editor.org/rfc/rfc5952.txt
4.2.3. Choice in Placement of "::"
When there is an alternative choice in the placement of a "::", the longest run of consecutive 16-bit 0 fields MUST be shortened (i.e., the sequence with three consecutive zero fields is shortened in 2001:0:0:1:0:0:0:1). When the length of the consecutive 16-bit 0 fields are equal (i.e., 2001:db8:0:0:1:0:0:1), the first sequence of zero bits MUST be shortened. For example, 2001:db8::1:0:0:1 is correct representation.
So in our case, IPv6: 2001:0000:0000:0db8:0000:0000:0000:0001 The right shortened representation should have been: 2001:0:0:db8::1