sqrl-redis-functions
Advanced tools
Comparing version 0.6.3 to 0.6.4
/// <reference types="node" /> | ||
import { RedisInterface } from "./RedisService"; | ||
import bignum = require("bignum"); | ||
import { Context, UniqueId } from "sqrl"; | ||
@@ -21,3 +20,3 @@ export declare const TIMESTAMP_BITS = 40; | ||
getBuffer(): Buffer; | ||
getBignum(): bignum; | ||
getBigInt(): bigint; | ||
getNumberString(): string; | ||
@@ -24,0 +23,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const RedisService_1 = require("./RedisService"); | ||
const bignum = require("bignum"); | ||
const sqrl_1 = require("sqrl"); | ||
const sqrl_common_1 = require("sqrl-common"); | ||
const bigint_buffer_1 = require("bigint-buffer"); | ||
exports.TIMESTAMP_BITS = 40; | ||
@@ -27,11 +27,9 @@ exports.TIMESTAMP_SIZE = Math.pow(2, exports.TIMESTAMP_BITS); | ||
getBuffer() { | ||
return this.getBignum().toBuffer({ endian: "big", size: 8 }); | ||
return bigint_buffer_1.toBufferBE(this.getBigInt(), 8); | ||
} | ||
getBignum() { | ||
return new bignum(this.timeMs) | ||
.shiftLeft(exports.TIMESTAMP_BITS) | ||
.add(this.remainder); | ||
getBigInt() { | ||
return ((BigInt(this.timeMs) << BigInt(exports.TIMESTAMP_BITS)) + BigInt(this.remainder)); | ||
} | ||
getNumberString() { | ||
return this.getBignum().toString(); | ||
return this.getBigInt().toString(); | ||
} | ||
@@ -38,0 +36,0 @@ } |
{ | ||
"name": "sqrl-redis-functions", | ||
"version": "0.6.3", | ||
"version": "0.6.4", | ||
"description": "SQRL (A Safe, Stateful Rules Language for Event Streams) - functions for storing state in redis", | ||
@@ -41,11 +41,11 @@ "homepage": "https://twitter.github.io/sqrl", | ||
"devDependencies": { | ||
"@types/jest": "^24.0.9", | ||
"@types/jest": "^24.0.18", | ||
"@types/node": "^11.9.5", | ||
"jest": "^24.3.1", | ||
"jest-extended": "^0.11.0", | ||
"prettier": "^1.15.3", | ||
"sqrl-test-utils": "^0.6.3", | ||
"ts-jest": "^24.0.0", | ||
"ts-node": "^8.0.2", | ||
"typescript": "^3.2.4" | ||
"jest": "^24.9.0", | ||
"jest-extended": "^0.11.2", | ||
"prettier": "^1.18.2", | ||
"sqrl-test-utils": "^0.6.4", | ||
"ts-jest": "^24.0.2", | ||
"ts-node": "^8.3.0", | ||
"typescript": "^3.6.2" | ||
}, | ||
@@ -56,12 +56,12 @@ "engines": { | ||
"dependencies": { | ||
"bignum": "^0.13.0", | ||
"bluebird": "^3.5.3", | ||
"bigint-buffer": "^1.1.2", | ||
"bluebird": "^3.7.2", | ||
"fast-stable-stringify": "^1.0.0", | ||
"ioredis": "^4.3.0", | ||
"moment": "^2.23.0", | ||
"murmurhash-native": "^3.3.0", | ||
"sqrl": "^0.6.3", | ||
"sqrl-common": "^0.6.3" | ||
"ioredis": "^4.19.1", | ||
"moment": "^2.24.0", | ||
"murmurhash-native": "^3.4.1", | ||
"sqrl": "^0.6.4", | ||
"sqrl-common": "^0.6.4" | ||
}, | ||
"gitHead": "0e5099d67899d9e6ff5bc4f6856f9e1cd34b9f3e" | ||
"gitHead": "822d8a8531bcf2b9b8dd324841b84cde9fd2bedb" | ||
} |
266752
7120
+ Addedbigint-buffer@^1.1.2
- Removedbignum@^0.13.0
- Removedbignum@0.13.1(transitive)
Updatedbluebird@^3.7.2
Updatedioredis@^4.19.1
Updatedmoment@^2.24.0
Updatedmurmurhash-native@^3.4.1
Updatedsqrl@^0.6.4
Updatedsqrl-common@^0.6.4