@xuda.io/xuda-worker-bundle 1.3.2140 → 1.3.2142
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.
- package/index.js +7 -0
- 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 = {};
|