utilitas 1989.9.41 → 1989.9.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import crypto from 'crypto';
2
+ import ensureString from './utilitas.mjs';
2
3
  import fs from 'fs';
3
4
  import qs from 'qs';
4
5
 
@@ -47,12 +48,18 @@ const digestObject = (object, algorithm) => {
47
48
  return hash(getSortedQueryString(object), algorithm);
48
49
  };
49
50
 
51
+ const hexToBigInt = (hex) => {
52
+ hex = `0x${ensureString(hex || '0').replace(/^0x/ig, '')}`;
53
+ return BigInt(hex, 16).toString(10);
54
+ };
55
+
50
56
  export {
51
57
  defaultAlgorithm,
52
58
  digestObject,
53
59
  getSortedQueryString,
54
60
  hash,
55
61
  hashFile,
62
+ hexToBigInt,
56
63
  random,
57
64
  randomString,
58
65
  sha256,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "utilitas",
3
3
  "description": "Just another common utility for Node.js.",
4
- "version": "1989.9.41",
4
+ "version": "1989.9.42",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",
@@ -25,16 +25,16 @@
25
25
  "url": "https://github.com/Leask/utilitas.git"
26
26
  },
27
27
  "dependencies": {
28
- "@sentry/node": "^6.17.9",
28
+ "@sentry/node": "^6.18.1",
29
29
  "base64url": "^3.0.1",
30
30
  "colors": "1.4.0",
31
- "fast-geoip": "^1.1.59",
31
+ "fast-geoip": "^1.1.61",
32
32
  "file-type": "^17.1.1",
33
33
  "ini": "github:Leask/ini",
34
34
  "ioredis": "^4.28.5",
35
35
  "jsonwebtoken": "^8.5.1",
36
36
  "mailgun-js": "^0.22.0",
37
- "mathjs": "^10.1.1",
37
+ "mathjs": "^10.3.0",
38
38
  "mysql2": "^2.3.3",
39
39
  "node-fetch": "^2.6.7",
40
40
  "node-mailjet": "^3.3.7",
@@ -43,7 +43,7 @@
43
43
  "tail": "^2.2.4",
44
44
  "telegraf": "^4.7.0",
45
45
  "telesignsdk": "^2.2.1",
46
- "twilio": "^3.74.0",
46
+ "twilio": "^3.75.0",
47
47
  "uuid": "^8.3.2"
48
48
  }
49
49
  }