0.1.0 • Published 8 years ago

eufa v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 years ago

Eufa

A high efficient utility functions library written in webassembly.

Use

# 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

  • Chrome v58 or higher (headless supported)
  • Node v8.2.1
  • NPM v5.3.0
  • Gulp v3.9.1
  • Emsdk (emscripten v1.37.13)
  • Binaryen latest version

Classes

  • Math

    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

Eufa.Math.f64_abs

Eufa.Math.i64_sqrt

Eufa.Math.f64_sqrt

  • String

Eufa.String.capitalize

  • Encryptor

Eufa.Encryptor.base64_encode

Eufa.Encryptor.base64_decode