The @iroha2/crypto-target-web
contains a crypto WASM compiled for the web
target.
This package provides crypto interface for native Web (ESM).
import { crypto, init } from '@iroha2/crypto-target-web'
init().then(() => {
// use crypto
})
Due to a known issue with Vite, you need to initialise WASM this way:
import { crypto, init } from '@iroha2/crypto-target-web' import wasmUrl from '@iroha2/crypto-target-web/wasm-pkg/iroha_crypto_bg.wasm?url' await init(wasmUrl)
See @iroha2/crypto-core
package for details.