0.2.5 • Published 4 years ago

cpf-wasm v0.2.5

Weekly downloads
14
License
MIT
Repository
github
Last release
4 years ago

cpf-wasm

The fastest node cpf validation lib out there.
Written in rust, compiled to WASM

Installation

Install using the package manager of your choice, it already ships with typings

$ npm add cpf-wasm
$ yarn add cpf-wasn

Quick start

const { isValid } = require('cpf-wasm');

isValid('41154981452')
// true

isValid('11111111111')
// false

Benchmarks

A synthetic load of validating 10 million cpfs was ran in order to benchmark our lib against the most popular cpf validation libs on npm. The libs we benchmarked against were:

The results obtained show that cpf-wasm is at least 1.53 X faster than other libs performing the same task

libtimeratio
cpf-wasm9.23s1.00
cpf19.02s2.06
@fnando/cpf14.10s1.53
cpf-check20.33s2.20

benchmark code can be found at the benchmark folder

Was this really necessary?

Probably not

Should I use this in production?

Probably not

0.2.3

4 years ago

0.2.2

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.1

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago