Closed SmartLayer closed 4 years ago
I wrote a simple test that erred:
const crypto = require("webcrypto"); var iv = crypto.getRandomValues(new Uint8Array(16)) console.log(iv)
turns out I should do this:
const crypto = require("webcrypto"); var iv = crypto.crypto.getRandomValues(new Uint8Array(16)) console.log(iv)
compared to the straightforward interface provided by trust-webcrypto
const crypto = require("@trust/webcrypto"); var iv = crypto.getRandomValues(new Uint8Array(16)) console.log(iv)
I think it's more intuitive to provide crypto object directly.
It just takes two more characters:
const { crypto } = require("webcrypto");
Thanks!
I wrote a simple test that erred:
turns out I should do this:
compared to the straightforward interface provided by trust-webcrypto
I think it's more intuitive to provide crypto object directly.