# Install\_code() - Easiest way to convert a .wasm module to \[Nat8\]?

**URL:** <https://forum.dfinity.org/t/install-code-easiest-way-to-convert-a-wasm-module-to-nat8/18919>\
**Category:** Language Support\
**Created:** [March 13, 2023, 1:13pm UTC](https://forum.dfinity.org/t/install-code-easiest-way-to-convert-a-wasm-module-to-nat8/18919 "2023-03-13T13:13:00Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![v1ctor](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/v1ctor/32/9360_2.png) [@v1ctor](https://forum.dfinity.org/u/v1ctor)\
**Post date:** [March 13, 2023, 2:06pm UTC](https://forum.dfinity.org/t/install-code-easiest-way-to-convert-a-wasm-module-to-nat8/18919/3 "2023-03-13T14:06:16Z")

</div>

Depending on the size of your Wasm module, the Motoko compiler won’t be able to process it if it’s an array. See: [https://github.com/dfinity/motoko/issues/3557](https://github.com/dfinity/motoko/issues/3557)

So you must convert your wasm module to hexadecimal first (there are a many options online and some Unix tools to do that offline) and convert the result to be compatible with Motoko’s Text, like:

```auto
let wasmModule: Blob = "\de\ad\be\ef";

```

Then it’s simple to install the module:

```auto
Cycles.add(300_000_000_000);
let id = await IC.create_canister({
     settings = ?{
        controllers = ?[Principal.fromActor(this)];
        compute_allocation = null;
        memory_allocation = null;
        freezing_threshold = null;
    }
});

```

```auto
  await IC.install_code({
      mode = #install;
      canister_id = id.canister_id;
      wasm_module = wasmModule;
      arg = to_candid({
          //your canister's arguments, ex: foo = 1234;
      });
  });

```

---

_[View the full topic](https://forum.dfinity.org/t/install-code-easiest-way-to-convert-a-wasm-module-to-nat8/18919)._
