Home

Awesome

Eufa

A high efficient utility functions library written in webassembly with profiling tools.

Features

Using

# Install efua through npm
npm install eufa --save

Please move 'eufa-module.wasm' from node_modules to some place where you can fetch it by xhr call.

import eufa from 'eufa';

// Init eufa first
eufa.init('static/eufa-module.wasm', () => {
    console.log(eufa.Encryptor.base64_encode('Hello WebAssembly, hello Eufa :)'));
});

Build

Pre-requisite

Install Emscripten SDK from official installing website.

Commands

# Install dependencies;
npm install

# Build
npm run build;

# Run test;
npm run test

# Run benchmark test;
npm run benchmark

Dependencies

Classes

Eufa.Math.i64_add<int, int>

Eufa.Math.f64_add<double, double>

Eufa.Math.i64_minus<int, int>

Eufa.Math.f64_minus<double, double>

Eufa.Math.i64_multiply<int, int>

Eufa.Math.f64_multiply<double, double>

Eufa.Math.i64_divide<int, int>

Eufa.Math.f64_divide<double, double>

Eufa.Math.i64_abs<int>

Eufa.Math.f64_abs<double>

Eufa.Math.i64_sqrt<int>

Eufa.Math.f64_sqrt<double>

Eufa.String.capitalize<string>

Eufa.Array.num_sort<array>

Eufa.Array.num_rsort<array>

Eufa.Encryptor.base64_encode<string>

Eufa.Encryptor.base64_decode<string>

Eufa.Encryptor.md5<string>

Eufa.Encryptor.sha1<string>

Eufa.Cache.set<string, string/number/object/array>

Eufa.Cache.get<string>

Eufa.Cache.del<string>

Eufa.Cache.clear<>

Tools (WIP)

Eufa try embedding some useful wasm profiling tools which wrote in Python, feel free to use them according to the following documentation.

Installation

# Install package;
python3 tools/setup.py install

Using

# Analyze the sections of a wasm module;
eufa-ds --module <path-to-module>

Copyright

The Eufa, MIT License. The PHP License, version 3.01.