1
0
mirror of https://github.com/fluencelabs/js-libp2p-crypto synced 2025-04-27 11:22:15 +00:00

17 lines
323 B
JavaScript
Raw Normal View History

2017-07-22 10:57:27 -07:00
/* global self */
'use strict'
module.exports = () => {
// This is only a shim for interfaces, not for functionality
if (typeof self !== 'undefined') {
require('webcrypto-shim')(self)
if (self.crypto) {
return self.crypto
}
}
throw new Error('Please use an environment with crypto support')
}