Skip to content

Latest commit

 

History

History

target-web

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

@iroha2/crypto-target-web

The @iroha2/crypto-target-web contains a crypto WASM compiled for the web target. This package provides crypto interface for native Web (ESM).

Usage

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.