expo-crypto 55.0.8 → 55.0.10
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/CHANGELOG.md +10 -0
- package/android/build.gradle +2 -2
- package/build/ExpoCrypto.web.d.ts.map +1 -1
- package/build/ExpoCrypto.web.js +12 -1
- package/build/ExpoCrypto.web.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/{55.0.8/expo.modules.crypto-55.0.8.module → 55.0.10/expo.modules.crypto-55.0.10.module} +7 -7
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/55.0.10/expo.modules.crypto-55.0.10.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/55.0.10/expo.modules.crypto-55.0.10.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/55.0.10/expo.modules.crypto-55.0.10.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/55.0.10/expo.modules.crypto-55.0.10.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/{55.0.8/expo.modules.crypto-55.0.8.pom → 55.0.10/expo.modules.crypto-55.0.10.pom} +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/55.0.10/expo.modules.crypto-55.0.10.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/55.0.10/expo.modules.crypto-55.0.10.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/55.0.10/expo.modules.crypto-55.0.10.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/55.0.10/expo.modules.crypto-55.0.10.pom.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/maven-metadata.xml +4 -4
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/maven-metadata.xml.sha512 +1 -1
- package/package.json +2 -2
- package/src/ExpoCrypto.web.ts +10 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/55.0.8/expo.modules.crypto-55.0.8.module.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/55.0.8/expo.modules.crypto-55.0.8.module.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/55.0.8/expo.modules.crypto-55.0.8.module.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/55.0.8/expo.modules.crypto-55.0.8.module.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/55.0.8/expo.modules.crypto-55.0.8.pom.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/55.0.8/expo.modules.crypto-55.0.8.pom.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/55.0.8/expo.modules.crypto-55.0.8.pom.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.crypto/55.0.8/expo.modules.crypto-55.0.8.pom.sha512 +0 -1
- /package/local-maven-repo/host/exp/exponent/expo.modules.crypto/{55.0.8/expo.modules.crypto-55.0.8-sources.jar → 55.0.10/expo.modules.crypto-55.0.10-sources.jar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.crypto/{55.0.8/expo.modules.crypto-55.0.8-sources.jar.md5 → 55.0.10/expo.modules.crypto-55.0.10-sources.jar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.crypto/{55.0.8/expo.modules.crypto-55.0.8-sources.jar.sha1 → 55.0.10/expo.modules.crypto-55.0.10-sources.jar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.crypto/{55.0.8/expo.modules.crypto-55.0.8-sources.jar.sha256 → 55.0.10/expo.modules.crypto-55.0.10-sources.jar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.crypto/{55.0.8/expo.modules.crypto-55.0.8-sources.jar.sha512 → 55.0.10/expo.modules.crypto-55.0.10-sources.jar.sha512} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.crypto/{55.0.8/expo.modules.crypto-55.0.8.aar → 55.0.10/expo.modules.crypto-55.0.10.aar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.crypto/{55.0.8/expo.modules.crypto-55.0.8.aar.md5 → 55.0.10/expo.modules.crypto-55.0.10.aar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.crypto/{55.0.8/expo.modules.crypto-55.0.8.aar.sha1 → 55.0.10/expo.modules.crypto-55.0.10.aar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.crypto/{55.0.8/expo.modules.crypto-55.0.8.aar.sha256 → 55.0.10/expo.modules.crypto-55.0.10.aar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.crypto/{55.0.8/expo.modules.crypto-55.0.8.aar.sha512 → 55.0.10/expo.modules.crypto-55.0.10.aar.sha512} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 55.0.10 — 2026-03-17
|
|
14
|
+
|
|
15
|
+
_This version does not introduce any user-facing changes._
|
|
16
|
+
|
|
17
|
+
## 55.0.9 — 2026-03-05
|
|
18
|
+
|
|
19
|
+
### 🐛 Bug fixes
|
|
20
|
+
|
|
21
|
+
- Access `crypto` on `globalThis` rather than just `window.crypto` ([#43405](https://github.com/expo/expo/pull/43405) by [@bradleyayers](https://github.com/bradleyayers))
|
|
22
|
+
|
|
13
23
|
## 55.0.8 — 2026-02-25
|
|
14
24
|
|
|
15
25
|
_This version does not introduce any user-facing changes._
|
package/android/build.gradle
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoCrypto.web.d.ts","sourceRoot":"","sources":["../src/ExpoCrypto.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,qBAAqB,EAAkB,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;;
|
|
1
|
+
{"version":3,"file":"ExpoCrypto.web.d.ts","sourceRoot":"","sources":["../src/ExpoCrypto.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,qBAAqB,EAAkB,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;;iCAc7E,qBAAqB,QAC1B,MAAM,WACH,mBAAmB,GAC3B,OAAO,CAAC,MAAM,CAAC;2BAkBK,MAAM,GAAG,UAAU;gCAIR,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;gCAIlC,UAAU;;2BAMf,mBAAmB,QAAQ,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;;AArCtF,wBAwCE"}
|
package/build/ExpoCrypto.web.js
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { CodedError } from 'expo-modules-core';
|
|
2
2
|
import { CryptoEncoding } from './Crypto.types';
|
|
3
|
-
const getCrypto = () =>
|
|
3
|
+
const getCrypto = () => {
|
|
4
|
+
if (typeof globalThis.crypto !== 'undefined') {
|
|
5
|
+
return globalThis.crypto;
|
|
6
|
+
}
|
|
7
|
+
else if (typeof window !== 'undefined') {
|
|
8
|
+
return window.crypto ?? window.msCrypto;
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
return crypto;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
4
14
|
export default {
|
|
5
15
|
async digestStringAsync(algorithm, data, options) {
|
|
16
|
+
const crypto = getCrypto();
|
|
6
17
|
if (!crypto.subtle) {
|
|
7
18
|
throw new CodedError('ERR_CRYPTO_UNAVAILABLE', 'Access to the WebCrypto API is restricted to secure origins (localhost/https).');
|
|
8
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoCrypto.web.js","sourceRoot":"","sources":["../src/ExpoCrypto.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAc,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAyB,cAAc,EAAuB,MAAM,gBAAgB,CAAC;AAE5F,MAAM,SAAS,GAAG,GAAW,EAAE,CAAC,MAAM,CAAC,MAAM,IAAK,MAAc,CAAC,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpoCrypto.web.js","sourceRoot":"","sources":["../src/ExpoCrypto.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAc,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAyB,cAAc,EAAuB,MAAM,gBAAgB,CAAC;AAE5F,MAAM,SAAS,GAAG,GAAW,EAAE;IAC7B,IAAI,OAAO,UAAU,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;QAC7C,OAAO,UAAU,CAAC,MAAM,CAAC;IAC3B,CAAC;SAAM,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QACzC,OAAO,MAAM,CAAC,MAAM,IAAK,MAAc,CAAC,QAAQ,CAAC;IACnD,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,CAAC;IAChB,CAAC;AACH,CAAC,CAAC;AAEF,eAAe;IACb,KAAK,CAAC,iBAAiB,CACrB,SAAgC,EAChC,IAAY,EACZ,OAA4B;QAE5B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACnB,MAAM,IAAI,UAAU,CAClB,wBAAwB,EACxB,gFAAgF,CACjF,CAAC;QACJ,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;QAClC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACpC,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QACjE,IAAI,OAAO,CAAC,QAAQ,KAAK,cAAc,CAAC,GAAG,EAAE,CAAC;YAC5C,OAAO,SAAS,CAAC,UAAU,CAAC,CAAC;QAC/B,CAAC;aAAM,IAAI,OAAO,CAAC,QAAQ,KAAK,cAAc,CAAC,MAAM,EAAE,CAAC;YACtD,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAClE,CAAC;QACD,MAAM,IAAI,UAAU,CAAC,mBAAmB,EAAE,iCAAiC,CAAC,CAAC;IAC/E,CAAC;IACD,cAAc,CAAC,MAAc;QAC3B,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;QACrC,OAAO,SAAS,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;IACD,KAAK,CAAC,mBAAmB,CAAC,MAAc;QACtC,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;QACrC,OAAO,SAAS,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;IACD,eAAe,CAAC,UAAsB;QACpC,OAAO,SAAS,EAAE,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;IACjD,CAAC;IACD,UAAU;QACR,OAAO,SAAS,EAAE,CAAC,UAAU,EAAE,CAAC;IAClC,CAAC;IACD,WAAW,CAAC,SAA8B,EAAE,IAAiB;QAC3D,OAAO,SAAS,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;CACF,CAAC;AAEF,SAAS,SAAS,CAAC,MAAmB;IACpC,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IAEzC,MAAM,QAAQ,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAC5C,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACnC,MAAM,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC/C,OAAO,aAAa,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["import { CodedError, TypedArray } from 'expo-modules-core';\n\nimport { CryptoDigestAlgorithm, CryptoEncoding, CryptoDigestOptions } from './Crypto.types';\n\nconst getCrypto = (): Crypto => {\n if (typeof globalThis.crypto !== 'undefined') {\n return globalThis.crypto;\n } else if (typeof window !== 'undefined') {\n return window.crypto ?? (window as any).msCrypto;\n } else {\n return crypto;\n }\n};\n\nexport default {\n async digestStringAsync(\n algorithm: CryptoDigestAlgorithm,\n data: string,\n options: CryptoDigestOptions\n ): Promise<string> {\n const crypto = getCrypto();\n if (!crypto.subtle) {\n throw new CodedError(\n 'ERR_CRYPTO_UNAVAILABLE',\n 'Access to the WebCrypto API is restricted to secure origins (localhost/https).'\n );\n }\n const encoder = new TextEncoder();\n const buffer = encoder.encode(data);\n const hashedData = await crypto.subtle.digest(algorithm, buffer);\n if (options.encoding === CryptoEncoding.HEX) {\n return hexString(hashedData);\n } else if (options.encoding === CryptoEncoding.BASE64) {\n return btoa(String.fromCharCode(...new Uint8Array(hashedData)));\n }\n throw new CodedError('ERR_CRYPTO_DIGEST', 'Invalid encoding type provided.');\n },\n getRandomBytes(length: number): Uint8Array {\n const array = new Uint8Array(length);\n return getCrypto().getRandomValues(array);\n },\n async getRandomBytesAsync(length: number): Promise<Uint8Array> {\n const array = new Uint8Array(length);\n return getCrypto().getRandomValues(array);\n },\n getRandomValues(typedArray: TypedArray) {\n return getCrypto().getRandomValues(typedArray);\n },\n randomUUID() {\n return getCrypto().randomUUID();\n },\n digestAsync(algorithm: AlgorithmIdentifier, data: ArrayBuffer): Promise<ArrayBuffer> {\n return getCrypto().subtle.digest(algorithm, data);\n },\n};\n\nfunction hexString(buffer: ArrayBuffer): string {\n const byteArray = new Uint8Array(buffer);\n\n const hexCodes = [...byteArray].map((value) => {\n const hexCode = value.toString(16);\n const paddedHexCode = hexCode.padStart(2, '0');\n return paddedHexCode;\n });\n\n return hexCodes.join('');\n}\n"]}
|
package/expo-module.config.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "host.exp.exponent",
|
|
5
5
|
"module": "expo.modules.crypto",
|
|
6
|
-
"version": "55.0.
|
|
6
|
+
"version": "55.0.10",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.crypto-55.0.
|
|
28
|
-
"url": "expo.modules.crypto-55.0.
|
|
27
|
+
"name": "expo.modules.crypto-55.0.10.aar",
|
|
28
|
+
"url": "expo.modules.crypto-55.0.10.aar",
|
|
29
29
|
"size": 110300,
|
|
30
30
|
"sha512": "ea4b2978895c10b839f099dc57ee2ea222237520a3553150ae45a0a3c8c707ae25bacf676860d7abd0b21c6c953ec5a98c8c5a0a1e89d579585ee660c45644c6",
|
|
31
31
|
"sha256": "a91df9dad8be5c24721c2a11ce43eb39e1b2e018278acdebc30579c7ca3632d3",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
],
|
|
54
54
|
"files": [
|
|
55
55
|
{
|
|
56
|
-
"name": "expo.modules.crypto-55.0.
|
|
57
|
-
"url": "expo.modules.crypto-55.0.
|
|
56
|
+
"name": "expo.modules.crypto-55.0.10.aar",
|
|
57
|
+
"url": "expo.modules.crypto-55.0.10.aar",
|
|
58
58
|
"size": 110300,
|
|
59
59
|
"sha512": "ea4b2978895c10b839f099dc57ee2ea222237520a3553150ae45a0a3c8c707ae25bacf676860d7abd0b21c6c953ec5a98c8c5a0a1e89d579585ee660c45644c6",
|
|
60
60
|
"sha256": "a91df9dad8be5c24721c2a11ce43eb39e1b2e018278acdebc30579c7ca3632d3",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
},
|
|
74
74
|
"files": [
|
|
75
75
|
{
|
|
76
|
-
"name": "expo.modules.crypto-55.0.
|
|
77
|
-
"url": "expo.modules.crypto-55.0.
|
|
76
|
+
"name": "expo.modules.crypto-55.0.10-sources.jar",
|
|
77
|
+
"url": "expo.modules.crypto-55.0.10-sources.jar",
|
|
78
78
|
"size": 10955,
|
|
79
79
|
"sha512": "ec34ade5aa4251d5f8502caa39cc0502e818cb617eb69067a7069a2832a95c5e6b7cc383ad5e7a82bde1a94e8e79e9ec8b9aa63485f694fcaaf222fb8d27db27",
|
|
80
80
|
"sha256": "4e2f1dc1f39f5728d6e365d24fd333827225b092149dc6422c63114933729131",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
849e609863af33bdadc1bdc85d4920be
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3fed217e452e02de9e73c193d3d9c18ed2e8733e
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
660c3d3019bf719d16c4aedfc71448dc1dd67fc1491faff1bc3566eda9d37035
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
afd36b3db2eb943fa74f39eed81f9f94e1c9985d3672117721c050827c3f0fea83b4c0fd5ac181326eaf4a0617db9bfdfb83d5ddfcfcba043ad2ad6393d01b35
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>host.exp.exponent</groupId>
|
|
11
11
|
<artifactId>expo.modules.crypto</artifactId>
|
|
12
|
-
<version>55.0.
|
|
12
|
+
<version>55.0.10</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.crypto</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
e71a78dcf9bde8294beac859faf951ae
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
24c59c327be62ca6d8f6a0b99b2e44c8046bb518
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5e0e59174451245a2a1acb0406317a9f8698a8f106b8ebda9f50f851b9c2bf64
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
18e7d3617392eae4037419ed1aff25f42c59330ed585476e1b4e63d87468212b6751ca78bdc7dab0e8a914d16e9fc66dcbfef5c6e20c295e87087c86c93ab538
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>host.exp.exponent</groupId>
|
|
4
4
|
<artifactId>expo.modules.crypto</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>55.0.
|
|
7
|
-
<release>55.0.
|
|
6
|
+
<latest>55.0.10</latest>
|
|
7
|
+
<release>55.0.10</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>55.0.
|
|
9
|
+
<version>55.0.10</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20260317165319</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
c32ff8bb6c23ca93e3da0d3cfcbc9847
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
757cf0143a4e4c201a5c4aa66d00bee0dd06c7ce
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
8de143487dbc2ebad6945c90113d9a3c486fa7ae1643b395405db0b93d92e625
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
6996a0db1024fcfe0992d1ab5dd4e607b64d06012af0056c6fc94a6ed56f31195265e9517d4261d4ac7c60dc32dc113c5bc3f5ba6be8f0da2e45fc3920ba9c38
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-crypto",
|
|
3
|
-
"version": "55.0.
|
|
3
|
+
"version": "55.0.10",
|
|
4
4
|
"description": "Provides cryptography primitives for Android, iOS and web.",
|
|
5
5
|
"main": "build/Crypto.js",
|
|
6
6
|
"types": "build/Crypto.d.ts",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"expo": "*"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "9260ae10a08271027d85792b7128e0d4883dca4d"
|
|
49
49
|
}
|
package/src/ExpoCrypto.web.ts
CHANGED
|
@@ -2,7 +2,15 @@ import { CodedError, TypedArray } from 'expo-modules-core';
|
|
|
2
2
|
|
|
3
3
|
import { CryptoDigestAlgorithm, CryptoEncoding, CryptoDigestOptions } from './Crypto.types';
|
|
4
4
|
|
|
5
|
-
const getCrypto = (): Crypto =>
|
|
5
|
+
const getCrypto = (): Crypto => {
|
|
6
|
+
if (typeof globalThis.crypto !== 'undefined') {
|
|
7
|
+
return globalThis.crypto;
|
|
8
|
+
} else if (typeof window !== 'undefined') {
|
|
9
|
+
return window.crypto ?? (window as any).msCrypto;
|
|
10
|
+
} else {
|
|
11
|
+
return crypto;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
6
14
|
|
|
7
15
|
export default {
|
|
8
16
|
async digestStringAsync(
|
|
@@ -10,6 +18,7 @@ export default {
|
|
|
10
18
|
data: string,
|
|
11
19
|
options: CryptoDigestOptions
|
|
12
20
|
): Promise<string> {
|
|
21
|
+
const crypto = getCrypto();
|
|
13
22
|
if (!crypto.subtle) {
|
|
14
23
|
throw new CodedError(
|
|
15
24
|
'ERR_CRYPTO_UNAVAILABLE',
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7db39eddecc48069ab762c49751689a2
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3975c88b38f25f078a79e58ba4d09f0031f34130
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
10fc8a60b1be230ae4196df05d934a48c1544cf9081b982d78f9bc49fe7ab586
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d0594d6bdd0608bd679d81d5c3685abcc916c269d7aa11b451c36df25dd3ab3d1a7acff8d8d524e69b216c9c4191b74900c5fb9e5ecb8cb6e6c544755fa5f100
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7680dbcff4d264ccb9489f41cb594024
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
13f40dad17d4e85638521dab83161de4943546e8
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
e0d698222876e0e5e89b7cf9a6c8e8b46df609fa36ea2d34b55491dab4fe13db
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
372522d5e7ae68793a5fe63b0205c27b2a53b55840fc74f2dca74bd9350dfca98b8f28b7d8be1dbe729de2d81076bcbb7bba0437d454207938a84c0eaa427863
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|