@gjsify/crypto 0.15.1 → 0.16.1
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 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{sha224 as e,sha256 as t,sha384 as n,sha512 as r,sha512_256 as i}from"@noble/hashes/sha2";import{md5 as a,sha1 as o}from"@noble/hashes/legacy";const s=[`md5`,`sha1`,`sha224`,`sha256`,`sha384`,`sha512`,`sha512-256`];function normalizeAlgorithm(e){return e.toLowerCase().replace(/-/g,``)}const c={sha1:o,sha224:e,sha256:t,sha384:n,sha512:r,sha512256:i,md5:a};function getNobleHash(e){let t=c[normalizeAlgorithm(e)];if(!t){let t=Error(`Unknown message digest: ${e}`);throw t.code=`ERR_CRYPTO_HASH_UNKNOWN`,t}return t}export{s as SUPPORTED_HASHES,getNobleHash,normalizeAlgorithm};
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{sha224 as e,sha256 as t,sha384 as n,sha512 as r,sha512_256 as i}from"@noble/hashes/sha2.js";import{md5 as a,sha1 as o}from"@noble/hashes/legacy.js";const s=[`md5`,`sha1`,`sha224`,`sha256`,`sha384`,`sha512`,`sha512-256`];function normalizeAlgorithm(e){return e.toLowerCase().replace(/-/g,``)}const c={sha1:o,sha224:e,sha256:t,sha384:n,sha512:r,sha512256:i,md5:a};function getNobleHash(e){let t=c[normalizeAlgorithm(e)];if(!t){let t=Error(`Unknown message digest: ${e}`);throw t.code=`ERR_CRYPTO_HASH_UNKNOWN`,t}return t}export{s as SUPPORTED_HASHES,getNobleHash,normalizeAlgorithm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{getNobleHash as e}from"./algos.js";import{Buffer as t}from"node:buffer";import{hmac as n}from"@noble/hashes/hmac";var Hmac=class{_hasher;_finalized=!1;constructor(r,i){let a=e(r),o;o=typeof i==`string`?t.from(i,`utf8`):i instanceof Uint8Array?i:t.from(i),this._hasher=n.create(a,o)}update(e,n){if(this._finalized)throw Error(`Digest already called`);let r;return r=typeof e==`string`?t.from(e,n??`utf8`):e instanceof Uint8Array?e:t.from(e),this._hasher.update(r),this}digest(e){if(this._finalized)throw Error(`Digest already called`);this._finalized=!0;let n=this._hasher.digest(),r=t.from(n);return e?r.toString(e):r}};function createHmac(e,t){return new Hmac(e,t)}export{Hmac,createHmac};
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{getNobleHash as e}from"./algos.js";import{Buffer as t}from"node:buffer";import{hmac as n}from"@noble/hashes/hmac.js";var Hmac=class{_hasher;_finalized=!1;constructor(r,i){let a=e(r),o;o=typeof i==`string`?t.from(i,`utf8`):i instanceof Uint8Array?i:t.from(i),this._hasher=n.create(a,o)}update(e,n){if(this._finalized)throw Error(`Digest already called`);let r;return r=typeof e==`string`?t.from(e,n??`utf8`):e instanceof Uint8Array?e:t.from(e),this._hasher.update(r),this}digest(e){if(this._finalized)throw Error(`Digest already called`);this._finalized=!0;let n=this._hasher.digest(),r=t.from(n);return e?r.toString(e):r}};function createHmac(e,t){return new Hmac(e,t)}export{Hmac,createHmac};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CHash } from '@noble/hashes/utils';
|
|
1
|
+
import { type CHash } from '@noble/hashes/utils.js';
|
|
2
2
|
/** The digest algorithms the NativeScript backend supports, in Node naming. */
|
|
3
3
|
export declare const SUPPORTED_HASHES: readonly ["md5", "sha1", "sha224", "sha256", "sha384", "sha512", "sha512-256"];
|
|
4
4
|
/** Normalise an algorithm name to lowercase without hyphens: "SHA-256" → "sha256". */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/crypto",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"description": "Node.js crypto module for Gjs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -74,18 +74,18 @@
|
|
|
74
74
|
"crypto"
|
|
75
75
|
],
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@gjsify/cli": "^0.
|
|
78
|
-
"@gjsify/unit": "^0.
|
|
77
|
+
"@gjsify/cli": "^0.16.1",
|
|
78
|
+
"@gjsify/unit": "^0.16.1",
|
|
79
79
|
"@types/diffie-hellman": "^5.0.3",
|
|
80
80
|
"@types/node": "^25.9.2",
|
|
81
81
|
"typescript": "^6.0.3"
|
|
82
82
|
},
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"@girs/glib-2.0": "
|
|
85
|
-
"@gjsify/buffer": "^0.
|
|
86
|
-
"@gjsify/stream": "^0.
|
|
87
|
-
"@gjsify/utils": "^0.
|
|
88
|
-
"@noble/hashes": "^
|
|
84
|
+
"@girs/glib-2.0": "^4.1.0",
|
|
85
|
+
"@gjsify/buffer": "^0.16.1",
|
|
86
|
+
"@gjsify/stream": "^0.16.1",
|
|
87
|
+
"@gjsify/utils": "^0.16.1",
|
|
88
|
+
"@noble/hashes": "^2.2.0"
|
|
89
89
|
},
|
|
90
90
|
"gjsify": {
|
|
91
91
|
"runtimes": {
|