-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
diff --git a/node_modules/@digitalcredentials/jsonld-signatures/lib/sha256digest-reactnative.js b/node_modules/@digitalcredentials/jsonld-signatures/lib/sha256digest-reactnative.js | ||
index d4012ad..8443cf3 100644 | ||
--- a/node_modules/@digitalcredentials/jsonld-signatures/lib/sha256digest-reactnative.js | ||
+++ b/node_modules/@digitalcredentials/jsonld-signatures/lib/sha256digest-reactnative.js | ||
@@ -3,7 +3,7 @@ | ||
*/ | ||
'use strict'; | ||
|
||
-const crypto = require('isomorphic-webcrypto'); | ||
+// const crypto = require('isomorphic-webcrypto'); | ||
require('fast-text-encoding'); | ||
|
||
module.exports = { | ||
@@ -17,7 +17,7 @@ module.exports = { | ||
async sha256digest({string}) { | ||
const bytes = new TextEncoder().encode(string); | ||
return new Uint8Array( | ||
- await crypto.subtle.digest({name: 'SHA-256'}, bytes) | ||
+ await global.crypto.subtle.digest({name: 'SHA-256'}, bytes) | ||
); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
diff --git a/node_modules/@digitalcredentials/rdf-canonize/lib/MessageDigest-reactnative.js b/node_modules/@digitalcredentials/rdf-canonize/lib/MessageDigest-reactnative.js | ||
index 3d50b27..243abe5 100644 | ||
--- a/node_modules/@digitalcredentials/rdf-canonize/lib/MessageDigest-reactnative.js | ||
+++ b/node_modules/@digitalcredentials/rdf-canonize/lib/MessageDigest-reactnative.js | ||
@@ -3,7 +3,7 @@ | ||
*/ | ||
'use strict'; | ||
|
||
-const crypto = require('isomorphic-webcrypto'); | ||
+// const crypto = require('isomorphic-webcrypto'); | ||
require('fast-text-encoding'); | ||
|
||
module.exports = class MessageDigest { | ||
@@ -15,7 +15,7 @@ module.exports = class MessageDigest { | ||
constructor(algorithm) { | ||
// check if crypto.subtle is available | ||
// check is here rather than top-level to only fail if class is used | ||
- if(!(crypto && crypto.subtle)) { | ||
+ if(!(global.crypto && global.crypto.subtle)) { | ||
throw new Error('crypto.subtle not found.'); | ||
} | ||
if(algorithm === 'sha256') { | ||
@@ -35,7 +35,7 @@ module.exports = class MessageDigest { | ||
async digest() { | ||
const data = new TextEncoder().encode(this._content); | ||
const buffer = new Uint8Array( | ||
- await crypto.subtle.digest(this.algorithm, data)); | ||
+ await global.crypto.subtle.digest(this.algorithm, data)); | ||
// return digest in hex | ||
let hex = ''; | ||
for(let i = 0; i < buffer.length; ++i) { |