ip-address
Advanced tools
Comparing version 5.0.2 to 5.1.0
@@ -7,3 +7,3 @@ #!/usr/bin/env node | ||
var sprintf = require('sprintf').sprintf; | ||
var sprintf = require('sprintf-js').sprintf; | ||
var cli = require('cli'); | ||
@@ -10,0 +10,0 @@ var cliff = require('cliff'); |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var common = require('./common.js'); | ||
var sprintf = require('sprintf').sprintf; | ||
var sprintf = require('sprintf-js').sprintf; | ||
var util = require('util'); | ||
@@ -8,0 +8,0 @@ |
@@ -7,3 +7,3 @@ 'use strict'; | ||
var merge = require('lodash.merge'); | ||
var sprintf = require('sprintf').sprintf; | ||
var sprintf = require('sprintf-js').sprintf; | ||
var util = require('util'); | ||
@@ -898,2 +898,22 @@ | ||
Address6.fromBuffer = function (buf) { | ||
var address = new Array(8); | ||
for (var i = 0; i < 8; i++) { | ||
address[i] = Number(buf.readUInt16BE(i * 2, true)).toString(16); | ||
} | ||
return new Address6(address.join(':')); | ||
}; | ||
Address6.prototype.toBuffer = function () { | ||
var buf = new Buffer(16); | ||
this.parsedAddress.forEach(function (octet, i) { | ||
buf.writeUInt16BE(parseInt(octet, 16), i * 2, true); | ||
}); | ||
return buf; | ||
}; | ||
module.exports = Address6; |
'use strict'; | ||
var sprintf = require('sprintf'); | ||
var sprintf = require('sprintf-js').sprintf; | ||
@@ -5,0 +5,0 @@ /** |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var helpers = require('./helpers.js'); | ||
var sprintf = require('sprintf').sprintf; | ||
var sprintf = require('sprintf-js').sprintf; | ||
@@ -8,0 +8,0 @@ /** |
'use strict'; | ||
var sprintf = require('sprintf').sprintf; | ||
var sprintf = require('sprintf-js').sprintf; | ||
@@ -5,0 +5,0 @@ var v6 = require('./constants.js'); |
@@ -10,3 +10,3 @@ { | ||
], | ||
"version": "5.0.2", | ||
"version": "5.1.0", | ||
"author": "Beau Gunderson <beau@beaugunderson.com> (https://beaugunderson.com/)", | ||
@@ -36,7 +36,7 @@ "license": "MIT", | ||
"lodash.merge": "^3.3.2", | ||
"sprintf": "0.1.x" | ||
"sprintf-js": "^1.0.3" | ||
}, | ||
"devDependencies": { | ||
"chai": "^3.3.0", | ||
"coveralls": "^2.11.4", | ||
"codecov.io": "^0.1.6", | ||
"documentation": "^2.1.0-alpha2", | ||
@@ -43,0 +43,0 @@ "istanbul": "^0.3.22", |
[![travis]](http://travis-ci.org/beaugunderson/ip-address) | ||
[![coverage]](https://coveralls.io/r/beaugunderson/ip-address?branch=master) | ||
[![codecov.io](https://codecov.io/github/beaugunderson/ip-address/coverage.svg?branch=master)](https://codecov.io/github/beaugunderson/ip-address?branch=master) | ||
[![downloads]](https://www.npmjs.com/package/ip-address) | ||
@@ -4,0 +4,0 @@ [![version]](https://www.npmjs.com/package/ip-address) |
'use strict'; | ||
var sprintf = require('sprintf').sprintf; | ||
var sprintf = require('sprintf-js').sprintf; | ||
var should = require('chai').should(); | ||
@@ -5,0 +5,0 @@ |
@@ -9,3 +9,3 @@ 'use strict'; | ||
var BigInteger = require('jsbn'); | ||
var sprintf = require('sprintf').sprintf; | ||
var sprintf = require('sprintf-js').sprintf; | ||
@@ -92,2 +92,9 @@ var Address6 = require('../lib/ipv6.js'); | ||
it('converts to and from a buffer', function () { | ||
var buf = topic.toBuffer(); | ||
var address = Address6.fromBuffer(buf); | ||
address.correctForm().should.equal(topic.correctForm()); | ||
}); | ||
it('gets the correct type', function () { | ||
@@ -94,0 +101,0 @@ topic.getType().should.equal('Global unicast'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42
368697
1
5773
2
+ Addedsprintf-js@^1.0.3
+ Addedsprintf-js@1.1.3(transitive)
- Removedsprintf@0.1.x
- Removedsprintf@0.1.5(transitive)