@xuda.io/xuda-worker-bundle 1.3.2139 → 1.3.2141

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.
Files changed (2) hide show
  1. package/index.js +7 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1046,6 +1046,13 @@ func.common.get_data_from_websocket = async function (SESSION_ID, serviceP, data
1046
1046
  dbs_calls();
1047
1047
  });
1048
1048
  };
1049
+
1050
+ func.common.sha256 = async function (str) {
1051
+ const enc = new TextEncoder();
1052
+ const buf = await crypto.subtle.digest('SHA-256', enc.encode(str));
1053
+ const bytes = new Uint8Array(buf);
1054
+ return [...bytes].map((b) => b.toString(16).padStart(2, '0')).join('');
1055
+ };
1049
1056
  glb.DEBUG_INFO_OBJ = {};
1050
1057
  // var CONNECTION_ATTEMPTS = 0;
1051
1058
  glb.APP_INFO = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-worker-bundle",
3
- "version": "1.3.2139",
3
+ "version": "1.3.2141",
4
4
  "description": "xuda framework",
5
5
  "main": "index.js",
6
6
  "scripts": {