kernel-ipfs/polyfill.js

14 lines
305 B
JavaScript
Raw Normal View History

2023-04-04 10:30:22 +00:00
import { Crypto } from "@peculiar/webcrypto";
import { Buffer } from "buffer";
let globalCrypto = self.crypto;
if (!globalCrypto.subtle) {
let subtleCrypto = new Crypto().subtle;
Object.defineProperty(globalCrypto, "subtle", {
get() {
return subtleCrypto;
},
});
}
export { Buffer };