New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cryptosat/private-voting

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cryptosat/private-voting

This library implements an API for running privacy-preserving ballots. The library can be compiled to WASM, making it suitable for use within a browser application (for Cryptosim), as well as part of the flight software.

  • 0.1.1
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-20%
Maintainers
4
Weekly downloads
 
Created
Source

Private Voting

This library implements an API for running privacy-preserving ballots. The library can be compiled to WASM, making it suitable for use within a browser application (for Cryptosim), as well as part of the flight software.

Installing prerequisites

Prerequisites include

  • cargo
  • wasm-pack

cargo can be installed using rustup. Follow the installation instructions on https://www.rust-lang.org/tools/install.

Once cargo is installed, wasm-pack can be installed by running

$ cargo install wasm-pack

Building and testing

To run the unit tests, execute

$ cargo test

To build the WASM target and its JS bindings, run

$ wasm-pack build --target web

The WASM target and JS bindings will then be placed in a pkg directory.

Testing in a browser

To run unit tests in a browser, execute

$ wasm-pack test --chrome

To test calling the compiled WASM from Javascript code, there is a simple HTML under the html directory, named test.html. It has to be served over HTTP and not just opened directly as a file in the browser, since otherwise, CORS policies will block importing the Javascript file with the WASM bindings.

Generating documentation

To build the documentation for the private_voting library, execute

 $ cargo doc
 

which outputs the documentation in HTML format under target/doc.

Publishing the package to NPM registry

Run the following commands

$ wasm-pack build --scope <organization>
$ wasm-pack login
$ cd pkg
$ npm publish --access public

FAQs

Package last updated on 18 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc