Table of Contents

Development Objectives

  1. See how small a binary can be produced when the SHA256 digest algorithm is implemented directly in WebAssembly Text
  2. Compare the runtime performance of the WebAssembly module with the native sha256sum program supplied with macOS

The Git repo containing the working software can be found here

Development Challenges

Two challenges had to be overcome during development:

  1. The SHA256 algorithm expects to handle data in network byte order, but WebAssembly only has numeric data types that automatically rearrange a value’s byte order according to the CPU’s endianness.
  2. Unit testing WASM functions within a module is an entirely manual process. This presented an interesting challenge - especially when writing unit tests for private WASM functions