Blog

  • Rucas

    Rucas

    Rucas is a small little esolang which can be used for many operations

    Usage is as follows:

    Arguments

    Arguments Explanation
    N N is any number you want
    $CELL $CELL is the value of the current cell
    $STACK $STACK is the value of the top cell of the stack, if stack is empty, value is 0
    N/A N/A You don’t have to enter anything at all

    Cell manipulation

    Operation Arguments Explanation
    ADD N/A : N : $CELL : $STACK add (1 : N : $CELL : $STACK) to current cell’s value
    SUB N/A : N : $CELL : $STACK subtract (1 : N : $CELL : $STACK) off current cell’s value

    Pointer manipulation

    Operation Arguments Explanation
    JMPR N/A : N : $CELL : $STACK Move the pointer (1 : N : $CELL : $STACK) cells to the right
    JMPL N/A : N : $CELL : $STACK Move the pointer (1 : N : $CELL : $STACK) cells to the left
    JMP N : $ CELL Jump to cell (N / $CELL)

    I/O

    Operation Arguments Explanation
    PRNTA N/A : N : $CELL : $STACK PRINT ASCII value, If (N : $CELL : $STACK) is given, PRINT ASCII vallue of (N / $CELL) cells
    PRNTD N/A PRINT Decimal value, If N is given, PRINT Decimal value of (N) cells
    CINP N/A Copy input to current cell we are on

    Statements

    Operation Arguments Explanation
    STLP N/A Start a loop if the current cells value isn’t 0
    NDLP N/A End a loop if the current cell value is 0
    IF $CELL : $STACK Runs the code inside the statement if ($CELL: $STACK) > 0
    IF EQL N : $STACK Runs the code inside the statement if (N : $STACK) == current cell
    ENDIF N/A End if statement

    Stack manipulation

    Operation Arguments Explanation
    PSHS N/A Push current cells value to the top of the stack
    CLRS N/A Clear the stack
    RMVS N/A Remove the bottom most value of the stack
    EQL TOPS N/A Set the value of the element on top of the stack to the current cell

    Mathematics

    Operation Arguments Explanation
    ADDS N/A Add the top two values on the stack together and push this value on top of the stack, If the value > 255 it will result in a int overflow
    SUBS N/A Subtract the second-top value from the top value on the stack and push this value on top of the stack, If the value < 0 it will result in a int overflow


    Visit original content creator repository
    https://github.com/rutgerklamer/Rucas

  • kubeformation

    kubeformation

    Create declarative specifications for your managed Kubernetes cloud vendor (GKE, AKS).

    GoDoc Chat on Discord Follow on Twitter

    Kubeformation Diagram

    Motivation

    With Kubernetes, it becomes possible to start making everything about your application declarative. As cloud vendors start providing managed Kubernetes services, provisioning a Kubernetes cluster via the vendor’s API becomes declarative as well.

    Kubeformation is a simple web UI and CLI that helps you create “Google Deployment manager” or “Azure Resoure Manager” templates which are a little painful to create by hand.

    Once you have this file, you can run your cloud vendor CLI on it to provision your cluster. You can edit this file to add vendor specific configuration too.

    Usage

    • Write cluster spec. [docs]
    • Use the kubeformation CLI to generate template. [docs]
    • Follow provider specific instructions to create the cluster. [docs]

    Example

    Here’s a spec that defines a Kubernetes cluster: cluster.yaml

    version: v1
    name: cluster-name
    provider: gke
    k8sVersion: "1.9"
    nodePools:
    - name: db-pool
      type: n1-standard-1
      size: 1
      labels:
        app: postgres
    - name: backend-pool
      type: n1-standard-2
      size: 2
      labels:
        app: backend
    volumes:
    - name: postgres
      size: 10

    kubeformation can read this file and generate Google Cloud Deployment Manager template, which can then be used with gcloud command to create the GKE cluster. This is a declarative template that can be used to further do create or modify the cluster.

    $ kubeformation -f cluster.yaml -o templates

    Then, use gcloud CLI to create the deployment. [docs]

    $ gcloud deployment-manager deployments create my-cluster --config templates/gke-cluster.yaml

    NOTE: kubeformation is exclusively meant for managed Kubernetes providers. The following providers are currently supported:

    1. Google Kubernetes Engine (GKE)
    2. Azure Container Service (AKS)

    Installation

    Download CLI for your platform from the releases page, add it to PATH and give execute permissions.

    $ chmod +x kubeformation

    Docs

    Read complete docs here.

    FAQ

    • Why cloud provider specific information, such as zone/region/location etc. does not appear in the cluster spec?
      • The purpose of Kubeformation is to bootstrap a cloud provider specific template that you can later modify according to your needs.

    Roadmap

    Kubeformation is open to evolution. Current goal is to support all managed Kubernetes vendors that support declarative specification.

    • EKS support (#10)
    • Other providers (#11)

    Contributing

    Kubeformation is an open source project licensed under Apache 2.0. Checkout the contributing guide to get started.

    Maintainers

    Current maintainers: @shahidh_k, @arvishankar, @JaisonTitus.

    Visit original content creator repository https://github.com/hasura/kubeformation
  • kubeformation

    kubeformation

    Create declarative specifications for your managed Kubernetes cloud vendor (GKE, AKS).

    GoDoc Chat on Discord Follow on Twitter

    Kubeformation Diagram

    Motivation

    With Kubernetes, it becomes possible to start making everything about your application declarative. As cloud vendors start providing managed Kubernetes services, provisioning a Kubernetes cluster via the vendor’s API becomes declarative as well.

    Kubeformation is a simple web UI and CLI that helps you create “Google Deployment manager” or “Azure Resoure Manager” templates which are a little painful to create by hand.

    Once you have this file, you can run your cloud vendor CLI on it to provision your cluster. You can edit this file to add vendor specific configuration too.

    Usage

    • Write cluster spec. [docs]
    • Use the kubeformation CLI to generate template. [docs]
    • Follow provider specific instructions to create the cluster. [docs]

    Example

    Here’s a spec that defines a Kubernetes cluster: cluster.yaml

    version: v1
    name: cluster-name
    provider: gke
    k8sVersion: "1.9"
    nodePools:
    - name: db-pool
      type: n1-standard-1
      size: 1
      labels:
        app: postgres
    - name: backend-pool
      type: n1-standard-2
      size: 2
      labels:
        app: backend
    volumes:
    - name: postgres
      size: 10

    kubeformation can read this file and generate Google Cloud Deployment Manager template, which can then be used with gcloud command to create the GKE cluster. This is a declarative template that can be used to further do create or modify the cluster.

    $ kubeformation -f cluster.yaml -o templates

    Then, use gcloud CLI to create the deployment. [docs]

    $ gcloud deployment-manager deployments create my-cluster --config templates/gke-cluster.yaml

    NOTE: kubeformation is exclusively meant for managed Kubernetes providers. The following providers are currently supported:

    1. Google Kubernetes Engine (GKE)
    2. Azure Container Service (AKS)

    Installation

    Download CLI for your platform from the releases page, add it to PATH and give execute permissions.

    $ chmod +x kubeformation

    Docs

    Read complete docs here.

    FAQ

    • Why cloud provider specific information, such as zone/region/location etc. does not appear in the cluster spec?
      • The purpose of Kubeformation is to bootstrap a cloud provider specific template that you can later modify according to your needs.

    Roadmap

    Kubeformation is open to evolution. Current goal is to support all managed Kubernetes vendors that support declarative specification.

    • EKS support (#10)
    • Other providers (#11)

    Contributing

    Kubeformation is an open source project licensed under Apache 2.0. Checkout the contributing guide to get started.

    Maintainers

    Current maintainers: @shahidh_k, @arvishankar, @JaisonTitus.

    Visit original content creator repository https://github.com/hasura/kubeformation
  • amiko_wx

    amiko_linux

    AmiKo/CoMed for Linux done with wxWidgets and C++, 64 bit.

    Prerequisites:

    • CMake

    • GTK 3

        $ sudo apt install libgtk-3-dev
      
    • WebKit2

        $ sudo apt install libwebkit2gtk-4.0-dev
      
    • SQlite is built-in into the application, so there is no dependency on system libraries.

    • JSON nlohmann

        $ git submodule init
        $ git submodule update
      

      then enable this in steps.conf

        STEP_CONFIGURE_JSON=y
        STEP_BUILD_JSON=y
        STEP_COPY_LANG_FILES=y
      
    • Libcurl

      Install:

        sudo apt install libcurl4-openssl-dev
      

      Or build:

        STEP_DOWNLOAD_SOURCES_CURL=y
        STEP_CONFIGURE_CURL=y
        STEP_BUILD_CURL=y
      
    • OpenSSL development libraries, required for the calculation of the patient hash (SHA256)

        $ sudo apt install libssl-dev
      
    • Smart card support

      • Developers

          $ sudo apt install libpcsclite-dev
        
      • Developers and users

          $ sudo apt install pcscd
        
    • uuidgen for the generation of prescription UUIDs

        $ uuidgen
      
    • To install dependencies on Gentoo:

        $ emerge net-libs/webkit-gtk x11-libs/wxGTK sys-apps/pcsc-lite
      

    Build Script

    1. Download and install latest wxWidgets from source using build script.
    2. Build script also has to download all data files, see OSX version.
    3. Build script has to build executables named AmiKo and CoMed.

    Config Hack

    In the file ~/AmiKo you can set language=57 on the first line. That will put the interface to English. In case you want to test in English.

    Setup

    1. Run build.sh
    2. Edit steps.conf
    3. Edit seed.conf
    4. Run build.sh again.

    Notes when building wxWidgets and SQLite

    1. For Mac in steps.conf

    STEP_CONFIGURE_WXWIDGETS=y
    STEP_COMPILE_WXWIDGETS=y
    
    STEP_CONFIGURE_JSON=y
    STEP_BUILD_JSON=y
    
    1. For Mac in seed.conf
    CONFIG_GENERATOR_MK=y
    

    Notes when building AmiKo/CoMed

    1. For Mac in steps.conf

    STEP_CONFIGURE_APP=y
    STEP_COMPILE_APP=y
    
    1. For Mac in seed.conf
    CONFIG_GENERATOR_XC=y
    

    macOS Installer

    1. Create a .pkg Installer for macOS that installs all the DB files in to ~/.AmiKo or ~/.CoMed

    Visit original content creator repository
    https://github.com/zdavatz/amiko_wx

  • cryptobench-js

    CryptoBench.js

    Benchmarks for javascript crypto libraries.

    Build Status

    The subject of tests are client-side javascript libraries under various environments:

    • node.js;
    • browsers;
    • cordova applications: Android and iOS.

    Benchmark tests performance of encryption and decryption of 1Mb random data.

    The latest benchmark

    • Machine: 2.2 GHz IntelCore i7, 16GB of 1600 MHz DDR3

    Libraries:

    Where is possible WebCrypto API is tested as a reference. A fallback to webcrypto-liner/asmcrypto.js is used if a native implementation is not available.

    Node.js

    Node.js 13.12.0 on Darwin 64-bit
    
    Benchmark: Encrypting 2 Kb of random data ...
    * asmcrypto.js (AES-CBC) x 4,036 ops/sec ±0.80% (86 runs sampled)
    * asmcrypto.js (AES-GCM) x 2,304 ops/sec ±0.49% (87 runs sampled)
    * crypto-js (AES-CBC) x 2,201 ops/sec ±0.66% (85 runs sampled)
    * forge (AES-CBC) x 14,976 ops/sec ±0.46% (87 runs sampled)
    * forge (AES-GCM) x 4,646 ops/sec ±0.48% (86 runs sampled)
    * js-nacl.js x 26,758 ops/sec ±0.50% (87 runs sampled)
    * libsodium.js x 26,499 ops/sec ±0.42% (89 runs sampled)
    * SJCL (AES-CCM) x 3,129 ops/sec ±0.30% (88 runs sampled)
    * SJCL (AES-GCM) x 804 ops/sec ±0.24% (88 runs sampled)
    * tweetnacl.js x 37,966 ops/sec ±0.58% (88 runs sampled)
    * WebCrypto API (AES-CBC) x 11,682 ops/sec ±5.28% (71 runs sampled)
    * WebCrypto API (AES-GCM) x 11,035 ops/sec ±6.01% (69 runs sampled)
    Fastest is tweetnacl.js
    
    Benchmark: Decrypting 2 Kb of random data ...
    * asmcrypto.js (AES-CBC) x 4,049 ops/sec ±1.90% (85 runs sampled)
    * asmcrypto.js (AES-GCM) x 2,308 ops/sec ±0.79% (87 runs sampled)
    * crypto-js (AES-CBC) x 3,101 ops/sec ±0.45% (88 runs sampled)
    * forge (AES-CBC) x 9,648 ops/sec ±0.31% (88 runs sampled)
    * forge (AES-GCM) x 4,305 ops/sec ±0.44% (88 runs sampled)
    * js-nacl.js x 24,975 ops/sec ±0.66% (90 runs sampled)
    * libsodium.js x 25,864 ops/sec ±0.40% (91 runs sampled)
    * SJCL (AES-CCM) x 3,109 ops/sec ±0.43% (91 runs sampled)
    * SJCL (AES-GCM) x 772 ops/sec ±0.32% (88 runs sampled)
    * tweetnacl.js x 36,578 ops/sec ±0.85% (89 runs sampled)
    * WebCrypto API (AES-CBC) x 11,682 ops/sec ±5.86% (72 runs sampled)
    * WebCrypto API (AES-GCM) x 11,208 ops/sec ±6.56% (71 runs sampled)
    Fastest is tweetnacl.js
    
    Benchmark: Encrypting 1 Mb of random data ...
    * asmcrypto.js (AES-CBC) x 49.78 ops/sec ±0.70% (64 runs sampled)
    * asmcrypto.js (AES-GCM) x 9.68 ops/sec ±0.26% (28 runs sampled)
    * crypto-js (AES-CBC) x 6.40 ops/sec ±0.65% (20 runs sampled)
    * forge (AES-CBC) x 11.97 ops/sec ±7.95% (34 runs sampled)
    * forge (AES-GCM) x 8.69 ops/sec ±0.95% (25 runs sampled)
    * js-nacl.js x 56.64 ops/sec ±0.27% (71 runs sampled)
    * libsodium.js x 57.09 ops/sec ±0.38% (71 runs sampled)
    * SJCL (AES-CCM) x 5.44 ops/sec ±0.63% (18 runs sampled)
    * SJCL (AES-GCM) x 1.51 ops/sec ±2.54% (8 runs sampled)
    * tweetnacl.js x 82.93 ops/sec ±1.04% (67 runs sampled)
    * WebCrypto API (AES-CBC) x 196 ops/sec ±10.40% (55 runs sampled)
    * WebCrypto API (AES-GCM) x 311 ops/sec ±11.66% (46 runs sampled)
    Fastest is WebCrypto API (AES-GCM)
    
    Benchmark: Decrypting 1 Mb of random data ...
    * asmcrypto.js (AES-CBC) x 51.34 ops/sec ±0.60% (64 runs sampled)
    * asmcrypto.js (AES-GCM) x 9.96 ops/sec ±0.33% (29 runs sampled)
    * crypto-js (AES-CBC) x 10.53 ops/sec ±1.24% (29 runs sampled)
    * forge (AES-CBC) x 14.11 ops/sec ±2.09% (37 runs sampled)
    * forge (AES-GCM) x 8.75 ops/sec ±7.66% (26 runs sampled)
    * js-nacl.js x 58.45 ops/sec ±0.71% (60 runs sampled)
    * libsodium.js x 58.90 ops/sec ±0.46% (59 runs sampled)
    * SJCL (AES-CCM) x 5.94 ops/sec ±0.50% (19 runs sampled)
    * SJCL (AES-GCM) x 1.53 ops/sec ±2.37% (8 runs sampled)
    * tweetnacl.js x 85.37 ops/sec ±0.84% (69 runs sampled)
    * WebCrypto API (AES-CBC) x 367 ops/sec ±11.73% (50 runs sampled)
    * WebCrypto API (AES-GCM) x 291 ops/sec ±9.66% (45 runs sampled)
    Fastest is WebCrypto API (AES-CBC)
    

    Google Chrome

    Chrome 81.0.4044.138 on OS X 10.15.3 64-bit
    
    Benchmark: Encrypting 2 Kb of random data ...
    * asmcrypto.js (AES-CBC) x 3,277 ops/sec ±2.99% (52 runs sampled)
    * asmcrypto.js (AES-GCM) x 2,136 ops/sec ±1.07% (63 runs sampled)
    * crypto-js (AES-CBC) x 2,153 ops/sec ±1.00% (61 runs sampled)
    * forge (AES-CBC) x 13,750 ops/sec ±0.58% (58 runs sampled)
    * forge (AES-GCM) x 3,857 ops/sec ±0.53% (62 runs sampled)
    * js-nacl.js x 24,270 ops/sec ±0.56% (62 runs sampled)
    * libsodium.js x 24,052 ops/sec ±0.47% (63 runs sampled)
    * SJCL (AES-CCM) x 3,073 ops/sec ±0.44% (63 runs sampled)
    * SJCL (AES-GCM) x 568 ops/sec ±0.31% (63 runs sampled)
    * tweetnacl.js x 34,495 ops/sec ±0.53% (63 runs sampled)
    * WebCrypto API (AES-CBC) x 11,432 ops/sec ±2.28% (55 runs sampled)
    * WebCrypto API (AES-GCM) x 11,109 ops/sec ±2.75% (54 runs sampled)
    Fastest is tweetnacl.js
    
    Benchmark: Decrypting 2 Kb of random data ...
    * asmcrypto.js (AES-CBC) x 3,546 ops/sec ±1.92% (22 runs sampled)
    * asmcrypto.js (AES-GCM) x 2,127 ops/sec ±1.41% (60 runs sampled)
    * crypto-js (AES-CBC) x 2,975 ops/sec ±0.66% (60 runs sampled)
    * forge (AES-CBC) x 10,198 ops/sec ±0.75% (59 runs sampled)
    * forge (AES-GCM) x 3,588 ops/sec ±0.49% (63 runs sampled)
    * js-nacl.js x 22,996 ops/sec ±0.49% (63 runs sampled)
    * libsodium.js x 23,840 ops/sec ±0.62% (64 runs sampled)
    * SJCL (AES-CCM) x 2,680 ops/sec ±0.96% (57 runs sampled)
    * SJCL (AES-GCM) x 133 ops/sec ±4.47% (21 runs sampled)
    * tweetnacl.js x 32,507 ops/sec ±0.46% (62 runs sampled)
    * WebCrypto API (AES-CBC) x 11,632 ops/sec ±2.39% (57 runs sampled)
    * WebCrypto API (AES-GCM) x 11,361 ops/sec ±2.30% (56 runs sampled)
    Fastest is tweetnacl.js
    
    Benchmark: Encrypting 1 Mb of random data ...
    * asmcrypto.js (AES-CBC) x 49.43 ops/sec ±0.37% (50 runs sampled)
    * asmcrypto.js (AES-GCM) x 9.81 ops/sec ±0.34% (28 runs sampled)
    * crypto-js (AES-CBC) x 6.65 ops/sec ±7.73% (21 runs sampled)
    * forge (AES-CBC) x 12.01 ops/sec ±7.25% (24 runs sampled)
    * forge (AES-GCM) x 8.63 ops/sec ±4.88% (25 runs sampled)
    * js-nacl.js x 53.13 ops/sec ±0.36% (45 runs sampled)
    * libsodium.js x 53.08 ops/sec ±0.35% (46 runs sampled)
    * SJCL (AES-CCM) x 4.30 ops/sec ±4.40% (15 runs sampled)
    * SJCL (AES-GCM) x 0.27 ops/sec ±0.16% (5 runs sampled)
    * tweetnacl.js x 74.06 ops/sec ±0.36% (53 runs sampled)
    * WebCrypto API (AES-CBC) x 198 ops/sec ±10.95% (39 runs sampled)
    * WebCrypto API (AES-GCM) x 477 ops/sec ±12.51% (37 runs sampled)
    Fastest is WebCrypto API (AES-GCM)
    
    Benchmark: Decrypting 1 Mb of random data ...
    * asmcrypto.js (AES-CBC) x 48.50 ops/sec ±0.81% (50 runs sampled)
    * asmcrypto.js (AES-GCM) x 9.87 ops/sec ±0.38% (28 runs sampled)
    * crypto-js (AES-CBC) x 9.97 ops/sec ±6.43% (28 runs sampled)
    * forge (AES-CBC) x 13.59 ops/sec ±4.13% (26 runs sampled)
    * forge (AES-GCM) x 8.39 ops/sec ±6.75% (25 runs sampled)
    * js-nacl.js x 52.93 ops/sec ±0.67% (46 runs sampled)
    * libsodium.js x 53.33 ops/sec ±0.30% (45 runs sampled)
    * SJCL (AES-CCM) x 5.14 ops/sec ±0.64% (17 runs sampled)
    * SJCL (AES-GCM) x 0.27 ops/sec ±0.41% (5 runs sampled)
    * tweetnacl.js x 74.18 ops/sec ±0.33% (54 runs sampled)
    * WebCrypto API (AES-CBC) x 515 ops/sec ±7.19% (40 runs sampled)
    * WebCrypto API (AES-GCM) x 430 ops/sec ±7.74% (31 runs sampled)
    Fastest is WebCrypto API (AES-CBC)
    

    Safari

    Safari 13.0.5 on OS X 10.15.3
    
    Benchmark: Encrypting 2 Kb of random data ...
    * asmcrypto.js (AES-CBC) x 12,701 ops/sec ±0.37% (65 runs sampled)
    * asmcrypto.js (AES-GCM) x 4,219 ops/sec ±0.59% (26 runs sampled)
    * crypto-js (AES-CBC) x 2,019 ops/sec ±0.48% (64 runs sampled)
    * forge (AES-CBC) x 4,081 ops/sec ±0.66% (65 runs sampled)
    * forge (AES-GCM) x 2,358 ops/sec ±0.57% (65 runs sampled)
    * js-nacl.js x 28,979 ops/sec ±0.23% (65 runs sampled)
    * libsodium.js x 27,025 ops/sec ±0.30% (63 runs sampled)
    * SJCL (AES-CCM) x 4,475 ops/sec ±1.41% (64 runs sampled)
    * SJCL (AES-GCM) x 317 ops/sec ±0.36% (60 runs sampled)
    * tweetnacl.js x 38,887 ops/sec ±0.26% (65 runs sampled)
    * WebCrypto API (AES-CBC) x 13,311 ops/sec ±1.18% (57 runs sampled)
    * WebCrypto API (AES-GCM) x 14,425 ops/sec ±0.85% (58 runs sampled)
    Fastest is tweetnacl.js
    
    Benchmark: Decrypting 2 Kb of random data ...
    * asmcrypto.js (AES-CBC) x 12,294 ops/sec ±0.85% (62 runs sampled)
    * asmcrypto.js (AES-GCM) x 4,313 ops/sec ±0.44% (63 runs sampled)
    * crypto-js (AES-CBC) x 7,133 ops/sec ±0.65% (40 runs sampled)
    * forge (AES-CBC) x 3,786 ops/sec ±1.88% (24 runs sampled)
    * forge (AES-GCM) x 2,359 ops/sec ±0.51% (63 runs sampled)
    * js-nacl.js x 28,247 ops/sec ±0.29% (64 runs sampled)
    * libsodium.js x 27,069 ops/sec ±0.42% (63 runs sampled)
    * SJCL (AES-CCM) x 4,387 ops/sec ±1.30% (26 runs sampled)
    * SJCL (AES-GCM) x 324 ops/sec ±0.51% (62 runs sampled)
    * tweetnacl.js x 38,227 ops/sec ±0.38% (65 runs sampled)
    * WebCrypto API (AES-CBC) x 16,079 ops/sec ±0.93% (55 runs sampled)
    * WebCrypto API (AES-GCM) x 15,528 ops/sec ±0.81% (60 runs sampled)
    Fastest is tweetnacl.js
    
    Benchmark: Encrypting 1 Mb of random data ...
    * asmcrypto.js (AES-CBC) x 65.00 ops/sec ±0.34% (54 runs sampled)
    * asmcrypto.js (AES-GCM) x 10.94 ops/sec ±0.42% (31 runs sampled)
    * crypto-js (AES-CBC) x 4.54 ops/sec ±6.04% (16 runs sampled)
    * forge (AES-CBC) x 6.66 ops/sec ±2.38% (21 runs sampled)
    * forge (AES-GCM) x 5.19 ops/sec ±1.32% (17 runs sampled)
    * js-nacl.js x 63.74 ops/sec ±0.54% (54 runs sampled)
    * libsodium.js x 60.64 ops/sec ±0.31% (51 runs sampled)
    * SJCL (AES-CCM) x 5.67 ops/sec ±5.61% (19 runs sampled)
    * SJCL (AES-GCM) x 0.65 ops/sec ±0.91% (6 runs sampled)
    * tweetnacl.js x 88.83 ops/sec ±0.54% (56 runs sampled)
    * WebCrypto API (AES-CBC) x 378 ops/sec ±1.55% (58 runs sampled)
    * WebCrypto API (AES-GCM) x 1,007 ops/sec ±0.30% (60 runs sampled)
    Fastest is WebCrypto API (AES-GCM)
    
    Benchmark: Decrypting 1 Mb of random data ...
    * asmcrypto.js (AES-CBC) x 63.97 ops/sec ±0.29% (54 runs sampled)
    * asmcrypto.js (AES-GCM) x 11.02 ops/sec ±0.36% (31 runs sampled)
    * crypto-js (AES-CBC) x 19.26 ops/sec ±4.62% (36 runs sampled)
    * forge (AES-CBC) x 7.02 ops/sec ±3.32% (22 runs sampled)
    * forge (AES-GCM) x 5.46 ops/sec ±0.50% (18 runs sampled)
    * js-nacl.js x 63.56 ops/sec ±0.47% (54 runs sampled)
    * libsodium.js x 60.40 ops/sec ±0.32% (51 runs sampled)
    * SJCL (AES-CCM) x 7.54 ops/sec ±3.97% (23 runs sampled)
    * SJCL (AES-GCM) x 0.65 ops/sec ±1.94% (6 runs sampled)
    * tweetnacl.js x 88.91 ops/sec ±0.37% (56 runs sampled)
    * WebCrypto API (AES-CBC) x 1,023 ops/sec ±33.22% (51 runs sampled)
    * WebCrypto API (AES-GCM) x 1,073 ops/sec ±2.37% (59 runs sampled)
    Fastest is WebCrypto API (AES-GCM)
    

    Firefox

    Firefox 76.0 on OS X 10.15
    
    Benchmark: Encrypting 2 Kb of random data ...
    * asmcrypto.js (AES-CBC) x 5,883 ops/sec ±1.65% (34 runs sampled)
    * asmcrypto.js (AES-GCM) x 2,982 ops/sec ±1.34% (20 runs sampled)
    * crypto-js (AES-CBC) x 3,135 ops/sec ±1.03% (64 runs sampled)
    * forge (AES-CBC) x 11,007 ops/sec ±2.26% (63 runs sampled)
    * forge (AES-GCM) x 3,075 ops/sec ±0.57% (63 runs sampled)
    * js-nacl.js x 26,281 ops/sec ±2.76% (59 runs sampled)
    * libsodium.js x 21,836 ops/sec ±0.58% (63 runs sampled)
    * SJCL (AES-CCM) x 2,192 ops/sec ±2.25% (61 runs sampled)
    * SJCL (AES-GCM) x 708 ops/sec ±1.13% (62 runs sampled)
    * tweetnacl.js x 19,726 ops/sec ±3.89% (57 runs sampled)
    * WebCrypto API (AES-CBC) x 18,174 ops/sec ±4.95% (52 runs sampled)
    * WebCrypto API (AES-GCM) x 16,575 ops/sec ±6.74% (51 runs sampled)
    Fastest is js-nacl.js
    
    Benchmark: Decrypting 2 Kb of random data ...
    * asmcrypto.js (AES-CBC) x 5,524 ops/sec ±2.12% (32 runs sampled)
    * asmcrypto.js (AES-GCM) x 2,868 ops/sec ±2.03% (55 runs sampled)
    * crypto-js (AES-CBC) x 3,936 ops/sec ±0.52% (63 runs sampled)
    * forge (AES-CBC) x 6,319 ops/sec ±0.69% (61 runs sampled)
    * forge (AES-GCM) x 3,088 ops/sec ±0.55% (62 runs sampled)
    * js-nacl.js x 26,823 ops/sec ±0.43% (62 runs sampled)
    * libsodium.js x 22,751 ops/sec ±0.35% (64 runs sampled)
    * SJCL (AES-CCM) x 2,187 ops/sec ±2.22% (63 runs sampled)
    * SJCL (AES-GCM) x 689 ops/sec ±0.63% (62 runs sampled)
    * tweetnacl.js x 19,920 ops/sec ±4.09% (58 runs sampled)
    * WebCrypto API (AES-CBC) x 20,042 ops/sec ±4.89% (52 runs sampled)
    * WebCrypto API (AES-GCM) x 17,212 ops/sec ±5.27% (53 runs sampled)
    Fastest is js-nacl.js
    
    Benchmark: Encrypting 1 Mb of random data ...
    * asmcrypto.js (AES-CBC) x 55.01 ops/sec ±0.62% (48 runs sampled)
    * asmcrypto.js (AES-GCM) x 10.60 ops/sec ±0.72% (30 runs sampled)
    * crypto-js (AES-CBC) x 7.40 ops/sec ±2.70% (22 runs sampled)
    * forge (AES-CBC) x 12.02 ops/sec ±3.21% (24 runs sampled)
    * forge (AES-GCM) x 8.22 ops/sec ±4.35% (25 runs sampled)
    * js-nacl.js x 60.03 ops/sec ±1.51% (51 runs sampled)
    * libsodium.js x 48.32 ops/sec ±1.56% (50 runs sampled)
    * SJCL (AES-CCM) x 4.54 ops/sec ±2.58% (16 runs sampled)
    * SJCL (AES-GCM) x 1.31 ops/sec ±0.82% (8 runs sampled)
    * tweetnacl.js x 49.89 ops/sec ±2.04% (48 runs sampled)
    * WebCrypto API (AES-CBC) x 214 ops/sec ±2.17% (55 runs sampled)
    * WebCrypto API (AES-GCM) x 164 ops/sec ±2.07% (56 runs sampled)
    Fastest is WebCrypto API (AES-CBC)
    
    Benchmark: Decrypting 1 Mb of random data ...
    * asmcrypto.js (AES-CBC) x 54.06 ops/sec ±1.08% (47 runs sampled)
    * asmcrypto.js (AES-GCM) x 10.29 ops/sec ±1.05% (30 runs sampled)
    * crypto-js (AES-CBC) x 9.52 ops/sec ±0.38% (27 runs sampled)
    * forge (AES-CBC) x 11.38 ops/sec ±5.37% (32 runs sampled)
    * forge (AES-GCM) x 8.32 ops/sec ±4.58% (25 runs sampled)
    * js-nacl.js x 60.75 ops/sec ±1.10% (52 runs sampled)
    * libsodium.js x 49.64 ops/sec ±0.29% (51 runs sampled)
    * SJCL (AES-CCM) x 4.63 ops/sec ±1.47% (16 runs sampled)
    * SJCL (AES-GCM) x 1.25 ops/sec ±0.59% (8 runs sampled)
    * tweetnacl.js x 50.69 ops/sec ±2.05% (53 runs sampled)
    * WebCrypto API (AES-CBC) x 314 ops/sec ±2.75% (56 runs sampled)
    * WebCrypto API (AES-GCM) x 163 ops/sec ±2.06% (55 runs sampled)
    Fastest is WebCrypto API (AES-CBC)
    

    History benchmarks

    Running

    Install dependencies:

    npm install
    

    Run with node.js:

    npm start
    

    Run with a browser:

    npm run serve
    

    After open a test page http://localhost:8080.

    Cordova

    Android SDK must be installed and an emulator/device should be running.

    npm run android
    

    Xcode must be installed before.

    npm run ios
    

    Useful links

    Visit original content creator repository https://github.com/mnasyrov/cryptobench-js
  • cryptobench-js

    CryptoBench.js

    Benchmarks for javascript crypto libraries.

    Build Status

    The subject of tests are client-side javascript libraries under various environments:

    • node.js;
    • browsers;
    • cordova applications: Android and iOS.

    Benchmark tests performance of encryption and decryption of 1Mb random data.

    The latest benchmark

    • Machine: 2.2 GHz IntelCore i7, 16GB of 1600 MHz DDR3

    Libraries:

    Where is possible WebCrypto API is tested as a reference. A fallback to webcrypto-liner/asmcrypto.js is used if a native implementation is not available.

    Node.js

    Node.js 13.12.0 on Darwin 64-bit
    
    Benchmark: Encrypting 2 Kb of random data ...
    * asmcrypto.js (AES-CBC) x 4,036 ops/sec ±0.80% (86 runs sampled)
    * asmcrypto.js (AES-GCM) x 2,304 ops/sec ±0.49% (87 runs sampled)
    * crypto-js (AES-CBC) x 2,201 ops/sec ±0.66% (85 runs sampled)
    * forge (AES-CBC) x 14,976 ops/sec ±0.46% (87 runs sampled)
    * forge (AES-GCM) x 4,646 ops/sec ±0.48% (86 runs sampled)
    * js-nacl.js x 26,758 ops/sec ±0.50% (87 runs sampled)
    * libsodium.js x 26,499 ops/sec ±0.42% (89 runs sampled)
    * SJCL (AES-CCM) x 3,129 ops/sec ±0.30% (88 runs sampled)
    * SJCL (AES-GCM) x 804 ops/sec ±0.24% (88 runs sampled)
    * tweetnacl.js x 37,966 ops/sec ±0.58% (88 runs sampled)
    * WebCrypto API (AES-CBC) x 11,682 ops/sec ±5.28% (71 runs sampled)
    * WebCrypto API (AES-GCM) x 11,035 ops/sec ±6.01% (69 runs sampled)
    Fastest is tweetnacl.js
    
    Benchmark: Decrypting 2 Kb of random data ...
    * asmcrypto.js (AES-CBC) x 4,049 ops/sec ±1.90% (85 runs sampled)
    * asmcrypto.js (AES-GCM) x 2,308 ops/sec ±0.79% (87 runs sampled)
    * crypto-js (AES-CBC) x 3,101 ops/sec ±0.45% (88 runs sampled)
    * forge (AES-CBC) x 9,648 ops/sec ±0.31% (88 runs sampled)
    * forge (AES-GCM) x 4,305 ops/sec ±0.44% (88 runs sampled)
    * js-nacl.js x 24,975 ops/sec ±0.66% (90 runs sampled)
    * libsodium.js x 25,864 ops/sec ±0.40% (91 runs sampled)
    * SJCL (AES-CCM) x 3,109 ops/sec ±0.43% (91 runs sampled)
    * SJCL (AES-GCM) x 772 ops/sec ±0.32% (88 runs sampled)
    * tweetnacl.js x 36,578 ops/sec ±0.85% (89 runs sampled)
    * WebCrypto API (AES-CBC) x 11,682 ops/sec ±5.86% (72 runs sampled)
    * WebCrypto API (AES-GCM) x 11,208 ops/sec ±6.56% (71 runs sampled)
    Fastest is tweetnacl.js
    
    Benchmark: Encrypting 1 Mb of random data ...
    * asmcrypto.js (AES-CBC) x 49.78 ops/sec ±0.70% (64 runs sampled)
    * asmcrypto.js (AES-GCM) x 9.68 ops/sec ±0.26% (28 runs sampled)
    * crypto-js (AES-CBC) x 6.40 ops/sec ±0.65% (20 runs sampled)
    * forge (AES-CBC) x 11.97 ops/sec ±7.95% (34 runs sampled)
    * forge (AES-GCM) x 8.69 ops/sec ±0.95% (25 runs sampled)
    * js-nacl.js x 56.64 ops/sec ±0.27% (71 runs sampled)
    * libsodium.js x 57.09 ops/sec ±0.38% (71 runs sampled)
    * SJCL (AES-CCM) x 5.44 ops/sec ±0.63% (18 runs sampled)
    * SJCL (AES-GCM) x 1.51 ops/sec ±2.54% (8 runs sampled)
    * tweetnacl.js x 82.93 ops/sec ±1.04% (67 runs sampled)
    * WebCrypto API (AES-CBC) x 196 ops/sec ±10.40% (55 runs sampled)
    * WebCrypto API (AES-GCM) x 311 ops/sec ±11.66% (46 runs sampled)
    Fastest is WebCrypto API (AES-GCM)
    
    Benchmark: Decrypting 1 Mb of random data ...
    * asmcrypto.js (AES-CBC) x 51.34 ops/sec ±0.60% (64 runs sampled)
    * asmcrypto.js (AES-GCM) x 9.96 ops/sec ±0.33% (29 runs sampled)
    * crypto-js (AES-CBC) x 10.53 ops/sec ±1.24% (29 runs sampled)
    * forge (AES-CBC) x 14.11 ops/sec ±2.09% (37 runs sampled)
    * forge (AES-GCM) x 8.75 ops/sec ±7.66% (26 runs sampled)
    * js-nacl.js x 58.45 ops/sec ±0.71% (60 runs sampled)
    * libsodium.js x 58.90 ops/sec ±0.46% (59 runs sampled)
    * SJCL (AES-CCM) x 5.94 ops/sec ±0.50% (19 runs sampled)
    * SJCL (AES-GCM) x 1.53 ops/sec ±2.37% (8 runs sampled)
    * tweetnacl.js x 85.37 ops/sec ±0.84% (69 runs sampled)
    * WebCrypto API (AES-CBC) x 367 ops/sec ±11.73% (50 runs sampled)
    * WebCrypto API (AES-GCM) x 291 ops/sec ±9.66% (45 runs sampled)
    Fastest is WebCrypto API (AES-CBC)
    

    Google Chrome

    Chrome 81.0.4044.138 on OS X 10.15.3 64-bit
    
    Benchmark: Encrypting 2 Kb of random data ...
    * asmcrypto.js (AES-CBC) x 3,277 ops/sec ±2.99% (52 runs sampled)
    * asmcrypto.js (AES-GCM) x 2,136 ops/sec ±1.07% (63 runs sampled)
    * crypto-js (AES-CBC) x 2,153 ops/sec ±1.00% (61 runs sampled)
    * forge (AES-CBC) x 13,750 ops/sec ±0.58% (58 runs sampled)
    * forge (AES-GCM) x 3,857 ops/sec ±0.53% (62 runs sampled)
    * js-nacl.js x 24,270 ops/sec ±0.56% (62 runs sampled)
    * libsodium.js x 24,052 ops/sec ±0.47% (63 runs sampled)
    * SJCL (AES-CCM) x 3,073 ops/sec ±0.44% (63 runs sampled)
    * SJCL (AES-GCM) x 568 ops/sec ±0.31% (63 runs sampled)
    * tweetnacl.js x 34,495 ops/sec ±0.53% (63 runs sampled)
    * WebCrypto API (AES-CBC) x 11,432 ops/sec ±2.28% (55 runs sampled)
    * WebCrypto API (AES-GCM) x 11,109 ops/sec ±2.75% (54 runs sampled)
    Fastest is tweetnacl.js
    
    Benchmark: Decrypting 2 Kb of random data ...
    * asmcrypto.js (AES-CBC) x 3,546 ops/sec ±1.92% (22 runs sampled)
    * asmcrypto.js (AES-GCM) x 2,127 ops/sec ±1.41% (60 runs sampled)
    * crypto-js (AES-CBC) x 2,975 ops/sec ±0.66% (60 runs sampled)
    * forge (AES-CBC) x 10,198 ops/sec ±0.75% (59 runs sampled)
    * forge (AES-GCM) x 3,588 ops/sec ±0.49% (63 runs sampled)
    * js-nacl.js x 22,996 ops/sec ±0.49% (63 runs sampled)
    * libsodium.js x 23,840 ops/sec ±0.62% (64 runs sampled)
    * SJCL (AES-CCM) x 2,680 ops/sec ±0.96% (57 runs sampled)
    * SJCL (AES-GCM) x 133 ops/sec ±4.47% (21 runs sampled)
    * tweetnacl.js x 32,507 ops/sec ±0.46% (62 runs sampled)
    * WebCrypto API (AES-CBC) x 11,632 ops/sec ±2.39% (57 runs sampled)
    * WebCrypto API (AES-GCM) x 11,361 ops/sec ±2.30% (56 runs sampled)
    Fastest is tweetnacl.js
    
    Benchmark: Encrypting 1 Mb of random data ...
    * asmcrypto.js (AES-CBC) x 49.43 ops/sec ±0.37% (50 runs sampled)
    * asmcrypto.js (AES-GCM) x 9.81 ops/sec ±0.34% (28 runs sampled)
    * crypto-js (AES-CBC) x 6.65 ops/sec ±7.73% (21 runs sampled)
    * forge (AES-CBC) x 12.01 ops/sec ±7.25% (24 runs sampled)
    * forge (AES-GCM) x 8.63 ops/sec ±4.88% (25 runs sampled)
    * js-nacl.js x 53.13 ops/sec ±0.36% (45 runs sampled)
    * libsodium.js x 53.08 ops/sec ±0.35% (46 runs sampled)
    * SJCL (AES-CCM) x 4.30 ops/sec ±4.40% (15 runs sampled)
    * SJCL (AES-GCM) x 0.27 ops/sec ±0.16% (5 runs sampled)
    * tweetnacl.js x 74.06 ops/sec ±0.36% (53 runs sampled)
    * WebCrypto API (AES-CBC) x 198 ops/sec ±10.95% (39 runs sampled)
    * WebCrypto API (AES-GCM) x 477 ops/sec ±12.51% (37 runs sampled)
    Fastest is WebCrypto API (AES-GCM)
    
    Benchmark: Decrypting 1 Mb of random data ...
    * asmcrypto.js (AES-CBC) x 48.50 ops/sec ±0.81% (50 runs sampled)
    * asmcrypto.js (AES-GCM) x 9.87 ops/sec ±0.38% (28 runs sampled)
    * crypto-js (AES-CBC) x 9.97 ops/sec ±6.43% (28 runs sampled)
    * forge (AES-CBC) x 13.59 ops/sec ±4.13% (26 runs sampled)
    * forge (AES-GCM) x 8.39 ops/sec ±6.75% (25 runs sampled)
    * js-nacl.js x 52.93 ops/sec ±0.67% (46 runs sampled)
    * libsodium.js x 53.33 ops/sec ±0.30% (45 runs sampled)
    * SJCL (AES-CCM) x 5.14 ops/sec ±0.64% (17 runs sampled)
    * SJCL (AES-GCM) x 0.27 ops/sec ±0.41% (5 runs sampled)
    * tweetnacl.js x 74.18 ops/sec ±0.33% (54 runs sampled)
    * WebCrypto API (AES-CBC) x 515 ops/sec ±7.19% (40 runs sampled)
    * WebCrypto API (AES-GCM) x 430 ops/sec ±7.74% (31 runs sampled)
    Fastest is WebCrypto API (AES-CBC)
    

    Safari

    Safari 13.0.5 on OS X 10.15.3
    
    Benchmark: Encrypting 2 Kb of random data ...
    * asmcrypto.js (AES-CBC) x 12,701 ops/sec ±0.37% (65 runs sampled)
    * asmcrypto.js (AES-GCM) x 4,219 ops/sec ±0.59% (26 runs sampled)
    * crypto-js (AES-CBC) x 2,019 ops/sec ±0.48% (64 runs sampled)
    * forge (AES-CBC) x 4,081 ops/sec ±0.66% (65 runs sampled)
    * forge (AES-GCM) x 2,358 ops/sec ±0.57% (65 runs sampled)
    * js-nacl.js x 28,979 ops/sec ±0.23% (65 runs sampled)
    * libsodium.js x 27,025 ops/sec ±0.30% (63 runs sampled)
    * SJCL (AES-CCM) x 4,475 ops/sec ±1.41% (64 runs sampled)
    * SJCL (AES-GCM) x 317 ops/sec ±0.36% (60 runs sampled)
    * tweetnacl.js x 38,887 ops/sec ±0.26% (65 runs sampled)
    * WebCrypto API (AES-CBC) x 13,311 ops/sec ±1.18% (57 runs sampled)
    * WebCrypto API (AES-GCM) x 14,425 ops/sec ±0.85% (58 runs sampled)
    Fastest is tweetnacl.js
    
    Benchmark: Decrypting 2 Kb of random data ...
    * asmcrypto.js (AES-CBC) x 12,294 ops/sec ±0.85% (62 runs sampled)
    * asmcrypto.js (AES-GCM) x 4,313 ops/sec ±0.44% (63 runs sampled)
    * crypto-js (AES-CBC) x 7,133 ops/sec ±0.65% (40 runs sampled)
    * forge (AES-CBC) x 3,786 ops/sec ±1.88% (24 runs sampled)
    * forge (AES-GCM) x 2,359 ops/sec ±0.51% (63 runs sampled)
    * js-nacl.js x 28,247 ops/sec ±0.29% (64 runs sampled)
    * libsodium.js x 27,069 ops/sec ±0.42% (63 runs sampled)
    * SJCL (AES-CCM) x 4,387 ops/sec ±1.30% (26 runs sampled)
    * SJCL (AES-GCM) x 324 ops/sec ±0.51% (62 runs sampled)
    * tweetnacl.js x 38,227 ops/sec ±0.38% (65 runs sampled)
    * WebCrypto API (AES-CBC) x 16,079 ops/sec ±0.93% (55 runs sampled)
    * WebCrypto API (AES-GCM) x 15,528 ops/sec ±0.81% (60 runs sampled)
    Fastest is tweetnacl.js
    
    Benchmark: Encrypting 1 Mb of random data ...
    * asmcrypto.js (AES-CBC) x 65.00 ops/sec ±0.34% (54 runs sampled)
    * asmcrypto.js (AES-GCM) x 10.94 ops/sec ±0.42% (31 runs sampled)
    * crypto-js (AES-CBC) x 4.54 ops/sec ±6.04% (16 runs sampled)
    * forge (AES-CBC) x 6.66 ops/sec ±2.38% (21 runs sampled)
    * forge (AES-GCM) x 5.19 ops/sec ±1.32% (17 runs sampled)
    * js-nacl.js x 63.74 ops/sec ±0.54% (54 runs sampled)
    * libsodium.js x 60.64 ops/sec ±0.31% (51 runs sampled)
    * SJCL (AES-CCM) x 5.67 ops/sec ±5.61% (19 runs sampled)
    * SJCL (AES-GCM) x 0.65 ops/sec ±0.91% (6 runs sampled)
    * tweetnacl.js x 88.83 ops/sec ±0.54% (56 runs sampled)
    * WebCrypto API (AES-CBC) x 378 ops/sec ±1.55% (58 runs sampled)
    * WebCrypto API (AES-GCM) x 1,007 ops/sec ±0.30% (60 runs sampled)
    Fastest is WebCrypto API (AES-GCM)
    
    Benchmark: Decrypting 1 Mb of random data ...
    * asmcrypto.js (AES-CBC) x 63.97 ops/sec ±0.29% (54 runs sampled)
    * asmcrypto.js (AES-GCM) x 11.02 ops/sec ±0.36% (31 runs sampled)
    * crypto-js (AES-CBC) x 19.26 ops/sec ±4.62% (36 runs sampled)
    * forge (AES-CBC) x 7.02 ops/sec ±3.32% (22 runs sampled)
    * forge (AES-GCM) x 5.46 ops/sec ±0.50% (18 runs sampled)
    * js-nacl.js x 63.56 ops/sec ±0.47% (54 runs sampled)
    * libsodium.js x 60.40 ops/sec ±0.32% (51 runs sampled)
    * SJCL (AES-CCM) x 7.54 ops/sec ±3.97% (23 runs sampled)
    * SJCL (AES-GCM) x 0.65 ops/sec ±1.94% (6 runs sampled)
    * tweetnacl.js x 88.91 ops/sec ±0.37% (56 runs sampled)
    * WebCrypto API (AES-CBC) x 1,023 ops/sec ±33.22% (51 runs sampled)
    * WebCrypto API (AES-GCM) x 1,073 ops/sec ±2.37% (59 runs sampled)
    Fastest is WebCrypto API (AES-GCM)
    

    Firefox

    Firefox 76.0 on OS X 10.15
    
    Benchmark: Encrypting 2 Kb of random data ...
    * asmcrypto.js (AES-CBC) x 5,883 ops/sec ±1.65% (34 runs sampled)
    * asmcrypto.js (AES-GCM) x 2,982 ops/sec ±1.34% (20 runs sampled)
    * crypto-js (AES-CBC) x 3,135 ops/sec ±1.03% (64 runs sampled)
    * forge (AES-CBC) x 11,007 ops/sec ±2.26% (63 runs sampled)
    * forge (AES-GCM) x 3,075 ops/sec ±0.57% (63 runs sampled)
    * js-nacl.js x 26,281 ops/sec ±2.76% (59 runs sampled)
    * libsodium.js x 21,836 ops/sec ±0.58% (63 runs sampled)
    * SJCL (AES-CCM) x 2,192 ops/sec ±2.25% (61 runs sampled)
    * SJCL (AES-GCM) x 708 ops/sec ±1.13% (62 runs sampled)
    * tweetnacl.js x 19,726 ops/sec ±3.89% (57 runs sampled)
    * WebCrypto API (AES-CBC) x 18,174 ops/sec ±4.95% (52 runs sampled)
    * WebCrypto API (AES-GCM) x 16,575 ops/sec ±6.74% (51 runs sampled)
    Fastest is js-nacl.js
    
    Benchmark: Decrypting 2 Kb of random data ...
    * asmcrypto.js (AES-CBC) x 5,524 ops/sec ±2.12% (32 runs sampled)
    * asmcrypto.js (AES-GCM) x 2,868 ops/sec ±2.03% (55 runs sampled)
    * crypto-js (AES-CBC) x 3,936 ops/sec ±0.52% (63 runs sampled)
    * forge (AES-CBC) x 6,319 ops/sec ±0.69% (61 runs sampled)
    * forge (AES-GCM) x 3,088 ops/sec ±0.55% (62 runs sampled)
    * js-nacl.js x 26,823 ops/sec ±0.43% (62 runs sampled)
    * libsodium.js x 22,751 ops/sec ±0.35% (64 runs sampled)
    * SJCL (AES-CCM) x 2,187 ops/sec ±2.22% (63 runs sampled)
    * SJCL (AES-GCM) x 689 ops/sec ±0.63% (62 runs sampled)
    * tweetnacl.js x 19,920 ops/sec ±4.09% (58 runs sampled)
    * WebCrypto API (AES-CBC) x 20,042 ops/sec ±4.89% (52 runs sampled)
    * WebCrypto API (AES-GCM) x 17,212 ops/sec ±5.27% (53 runs sampled)
    Fastest is js-nacl.js
    
    Benchmark: Encrypting 1 Mb of random data ...
    * asmcrypto.js (AES-CBC) x 55.01 ops/sec ±0.62% (48 runs sampled)
    * asmcrypto.js (AES-GCM) x 10.60 ops/sec ±0.72% (30 runs sampled)
    * crypto-js (AES-CBC) x 7.40 ops/sec ±2.70% (22 runs sampled)
    * forge (AES-CBC) x 12.02 ops/sec ±3.21% (24 runs sampled)
    * forge (AES-GCM) x 8.22 ops/sec ±4.35% (25 runs sampled)
    * js-nacl.js x 60.03 ops/sec ±1.51% (51 runs sampled)
    * libsodium.js x 48.32 ops/sec ±1.56% (50 runs sampled)
    * SJCL (AES-CCM) x 4.54 ops/sec ±2.58% (16 runs sampled)
    * SJCL (AES-GCM) x 1.31 ops/sec ±0.82% (8 runs sampled)
    * tweetnacl.js x 49.89 ops/sec ±2.04% (48 runs sampled)
    * WebCrypto API (AES-CBC) x 214 ops/sec ±2.17% (55 runs sampled)
    * WebCrypto API (AES-GCM) x 164 ops/sec ±2.07% (56 runs sampled)
    Fastest is WebCrypto API (AES-CBC)
    
    Benchmark: Decrypting 1 Mb of random data ...
    * asmcrypto.js (AES-CBC) x 54.06 ops/sec ±1.08% (47 runs sampled)
    * asmcrypto.js (AES-GCM) x 10.29 ops/sec ±1.05% (30 runs sampled)
    * crypto-js (AES-CBC) x 9.52 ops/sec ±0.38% (27 runs sampled)
    * forge (AES-CBC) x 11.38 ops/sec ±5.37% (32 runs sampled)
    * forge (AES-GCM) x 8.32 ops/sec ±4.58% (25 runs sampled)
    * js-nacl.js x 60.75 ops/sec ±1.10% (52 runs sampled)
    * libsodium.js x 49.64 ops/sec ±0.29% (51 runs sampled)
    * SJCL (AES-CCM) x 4.63 ops/sec ±1.47% (16 runs sampled)
    * SJCL (AES-GCM) x 1.25 ops/sec ±0.59% (8 runs sampled)
    * tweetnacl.js x 50.69 ops/sec ±2.05% (53 runs sampled)
    * WebCrypto API (AES-CBC) x 314 ops/sec ±2.75% (56 runs sampled)
    * WebCrypto API (AES-GCM) x 163 ops/sec ±2.06% (55 runs sampled)
    Fastest is WebCrypto API (AES-CBC)
    

    History benchmarks

    Running

    Install dependencies:

    npm install
    

    Run with node.js:

    npm start
    

    Run with a browser:

    npm run serve
    

    After open a test page http://localhost:8080.

    Cordova

    Android SDK must be installed and an emulator/device should be running.

    npm run android
    

    Xcode must be installed before.

    npm run ios
    

    Useful links

    Visit original content creator repository https://github.com/mnasyrov/cryptobench-js
  • instruments_activity_detection

    Instruments Activity Detection using Spleeter and Auditok

    Detect individual instruments activity in an audio file.

    This project relies on spleeter for performing source separation and on auditok for the activity detection.

    Installation

    for Auditok run

    git clone https://github.com/amsehili/auditok.git
    cd auditok
    python setup.py install

    then run

    pip install -r requirements.txt

    Usage

    Provide an audio file

    python run.py -a my_audio_file.mp3

    use youtube-dl to download from a query of [artist] [song]

    python run.py david_bowie life_on_mars

    Output

    start-end-duration of each instrument is saved as [instrument].txt in the data dir.

    Instruments Timeline
    
         start tags
    0      8.0   🎤🎶
    265   10.0    🎶
    140   10.0    🎹
    266   12.0    🎶
    210   12.0    🎸
    ..     ...  ...
    136  239.0    🥁
    137  239.0    🥁
    264  239.0    🎸
    138  241.0    🥁
    139  243.0    🥁

     drums 
    
       start    end  duration
    0  35.20  35.51      0.31
    1  41.97  42.97      1.00
    2  46.13  46.48      0.35
    3  49.47  49.83      0.36
    4  56.91  61.20      4.29
    -------------------
    
     piano 
    
       start    end  duration
    0   9.99  10.33      0.34
    1  11.96  16.96      5.00
    2  16.96  21.96      5.00
    3  21.96  26.96      5.00
    4  26.96  29.23      2.27
    -------------------
    
     vocals 
    
       start    end  duration
    0   8.21  12.98      4.77
    1  14.47  17.52      3.05
    2  18.61  21.50      2.89
    3  22.75  25.95      3.20
    4  26.96  30.21      3.25
    -------------------
    
     other 
    
       start    end  duration
    0   8.21   9.21      1.00
    1   9.68  11.09      1.41
    2  11.87  13.16      1.29
    3  13.24  15.55      2.31
    4  15.58  20.58      5.00
    -------------------
    
     bass 
    
       start    end  duration
    0  11.89  14.92      3.03
    1  14.94  19.55      4.61
    2  21.23  23.37      2.14
    3  31.82  34.74      2.92
    4  35.68  36.83      1.15
    -------------------
    
    Instruments and their durations:
    
    other 231.89
    bass 206.09
    drums 161.37
    vocals 159.87
    piano 107.38

    Visit original content creator repository
    https://github.com/shoegazerstella/instruments_activity_detection

  • magenta-piano-duet-api

    Magenta Piano Duet API

    Magenta developed a cool website to play piano with an AI in your browser. Discussing with @ghalestrilo we realized it might be useful to develop easier ways to interact with this technology programatically so I made this simple REST API.

    How do I use it?

    You need to provide general details like tempo and length of the prediction to the AI, also the previous notes you want the machine to continue (if any).

    Note: If you use the free public endpoint it might take a few seconds to start (it goes to sleep during inactivity) after that it should have a good time response.

    The input data should look like this

    {'pitches': [60, 60, 61, 62], 'start_times': [0, 1, 2, 3], 'durations': [1, 1, 1, 2], 'tempo': 120, 'length': 10}

    The predicted value you get as output will looks like this

    {'pitches': [60, 60, 61, 62, 64, 60, 60, 62], 'start_times': [0.0, 1.0, 2.0, 3.0, 6.0, 7.0, 8.0, 9.0], 'durations': [1.0, 1.0, 1.0, 2.0, 1.0, 1.0, 1.0, 1.0]}

    Usage examples

    Using CURL

    curl --header "Content-Type: application/json" --request POST --data '{"pitches": [60, 60, 61, 62], "start_times": [0, 1, 2, 3], "durations": [1, 1, 1, 2], "tempo": 120, "length": 10}' https://ai-duet-ilfqxfroaq-uc.a.run.app/predict

    Using Python

    python client.py

    How do I run the server locally?

    1. Install requirements

    pip install -r requirements.txt

    2. Run server

    python server.py
    Visit original content creator repository https://github.com/mathigatti/magenta-piano-duet-api
  • tg-uv2

    Visit original content creator repository
    https://github.com/cmang/tg-uv2

  • Peripherals-and-Interfacing-Code-Assembly-

    Periphhals-and-Interfacing-CodeAssembly-

    1. Use 8086 Interfacing Trainer in Kit mode to make a traffic-controlling system with three LEDs as the representing light of Red, Green, and Yellow color light. Here the lights will be displayed according to the following sequence and time periods. Red light -> Yellow light -> Green light → Yellow light -> Red light

    Red light will be displayed for 10 seconds, Yellow light for 5 seconds and Green light for 15 seconds. The output will be continued until the system is reset.

    1. Use 8086 Interfacing Trainer in Kit mode to display letters E, F, and H in an 8×8 dot matrix LED with a delay of 5 seconds between each display. The output will be continued until the system is reset.

    2. Use 8086 Interfacing Trainer in Kit mode to display digits 1, 2, and 3 in a 7-Segment LED with a delay of 5 seconds between each display. The output will be continued until the system is reset.

    3. Use 8086 Interfacing Trainer in Kit mode to display a vertical line of LEDs in an 8×8 dot matrix LEDs and then shift the display from left to right with a delay of 5 seconds between each display. The output will be continued until the system is reset.

    4. Use 8086 Interfacing Trainer in Kit mode to display a horizontal line of LEDs in an 8×8 dot matrix LEDs and then shift the display from top to bottom with a delay of 5 seconds between each display. The output will be continued until the system is reset.

    Visit original content creator repository
    https://github.com/aminul-islam-niloy/Peripherals-and-Interfacing-Code-Assembly-