1.0.2 • Published 7 months ago

nv-time-buf v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

nv-time-buf

  • a 16-byte buffer for test date-transfer with nvlang,
  • the first-8-byte is a nan-tag (0xfff4)
  • nvlang has 4 date-type:
  • 0x7ffa,0x7ffb,0x7ffc ARE 8-byte inline-date but NOT compatible with JS.
  • 0xfff4 ARE 16-byte big-and-slow, but compatible with JS.

  • the api is simple version of nv-facutil-clock/nv-facutil-luna

install

  • npm install nv-time-buf

splitted

usage

  const x   = require("nv-time-buf");

example

		const x = require("nv-time-buf")
		> var dt = new Date();
		> var mts = dt.getTime();
		> var tmbuf = x(mts)
		> tmbuf
		TimeBuf [{
		  "moffset": 0,
		  "zone": "-0000",
		  "zone_desc": "Coordinated Universal Time",
		  "y": 2023,
		  "m": 10,
		  "d": 5,
		  "h": 12,
		  "min": 31,
		  "s": 19,
		  "ms": 986
		}] {}
		> tmbuf.f64a
		Float64Array(2) [ NaN, 2.0007534013768344 ]
		> tmbuf.f64a.buffer
		ArrayBuffer {
		  [Uint8Contents]: <7a 7e 00 64 2c 1f f4 ff b2 31 d2 ff 8a 01 00 40>,
		  byteLength: 16
		}
		> tmbuf.utc_wd
		4
		> tmbuf.lcl_wd
		4
		> dt
		2023-10-05T12:31:19.986Z

METHODS

APIS

LICENSE

  • ISC