Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-opcua-date-time

Package Overview
Dependencies
Maintainers
1
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-opcua-date-time - npm Package Compare versions

Comparing version 0.5.0 to 2.0.0-alpha.2

dist/date_time.d.ts

15

package.json
{
"name": "node-opcua-date-time",
"main": "./src/date_time.js",
"version": "0.5.0",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"version": "2.0.0-alpha.2",
"description": "pure nodejs OPCUA SDK - module -date-time",
"scripts": {
"build": "tsc",
"test": "mocha test"

@@ -11,9 +13,10 @@ },

"long": "^4.0.0",
"node-opcua-assert": "^0.5.0",
"node-opcua-assert": "^2.0.0-alpha.2",
"underscore": "^1.9.1"
},
"devDependencies": {
"@types/underscore": "^1.8.9",
"bignumber.js": "^7.2.1",
"node-opcua-benchmarker": "^0.5.0",
"node-opcua-binary-stream": "^0.5.0",
"node-opcua-benchmarker": "^2.0.0-alpha.2",
"node-opcua-binary-stream": "^2.0.0-alpha.2",
"should": "13.2.3"

@@ -36,3 +39,3 @@ },

"homepage": "http://node-opcua.github.io/",
"gitHead": "7c2f2dcb6ebdc49e57da1a028406a307df502d4e"
"gitHead": "7f57dd90e9d8bd1abcb8d330b3470999ac51e33f"
}

2

test/test_clock_performance.js
"use strict";
const should = require("should");
const getCurrentClock= require("../src/date_time").getCurrentClock;
const getCurrentClock= require("..").getCurrentClock;

@@ -6,0 +6,0 @@ const Benchmarker = require("node-opcua-benchmarker").Benchmarker;

@@ -8,8 +8,11 @@ "use strict";

const date_time = require("..");
const ec = require("../src/encode_decode");
const offsetFactor1601 = date_time.offsetFactor1601;
const randomDateTime =date_time.randomDateTime;
const decodeDateTime =date_time.decodeDateTime;
const encodeDateTime =date_time.encodeDateTime;
const offset_factor_1601 = date_time.offset_factor_1601;
const offset = offset_factor_1601[0];
const factor = offset_factor_1601[1];
const offset = offsetFactor1601[0];
const factor = offsetFactor1601[1];
const Long = require("long");
const getCurrentClock= require("..").getCurrentClock;

@@ -129,3 +132,3 @@

const stream = new BinaryStream(buf);
const date = ec.decodeDateTime(stream);
const date = decodeDateTime(stream);
//xx console.log("DDD = ",date.toUTCString(), " ms=", date.getMilliseconds());

@@ -171,4 +174,4 @@ date.toISOString().should.eql("2013-12-12T07:36:09.747Z");

function bn_hundredNanoSecondFrom1601ToDate_big_number(high, low) {
const offset = offset_factor_1601[0];
const factor = offset_factor_1601[1];
const offset = offsetFactor1601[0];
const factor = offsetFactor1601[1];
let value = new BigNumber(high).times(0x100000000).plus(low).div(factor).minus(offset);

@@ -285,3 +288,3 @@ value = parseInt(value, 10);

for (i = 0; i < 100; i++) {
dates_to_check.push(ec.randomDateTime());
dates_to_check.push(randomDateTime());
}

@@ -302,3 +305,3 @@ let date, check_date, check_date_bn;

isValidInt32(hl[1]).should.eql(true);
ec.encodeDateTime(date, bs);
encodeDateTime(date, bs);
bs.rewind();

@@ -512,6 +515,6 @@ }

ec.encodeDateTime(date,stream);
encodeDateTime(date,stream);
stream.rewind();
const dateVerif1 = ec.decodeDateTime(stream);
const dateVerif1 = decodeDateTime(stream);

@@ -522,3 +525,2 @@ dateVerif1.getTime().should.eql(date.getTime());

const getCurrentClock= require("../src/date_time").getCurrentClock;

@@ -525,0 +527,0 @@ it("should convert a time to 100nano and back",function() {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc