# node-libhydrogen-binding

> Bindings for libhydrogen

Latest version **0.0.3** (published 2019-11-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install node-libhydrogen-binding
pnpm add node-libhydrogen-binding
yarn add node-libhydrogen-binding
bun add node-libhydrogen-binding
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2019-11-18 |
| First published | 2018-06-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 164.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 4 |
| Author | Fabian Beier-Trampusch |
| Maintainers | trampi |

## Links

- npm: https://www.npmjs.com/package/node-libhydrogen-binding
- Repository: https://github.com/trampi/node-libhydrogen-binding
- Homepage: https://github.com/trampi/node-libhydrogen-binding#readme
- Issues: https://github.com/trampi/node-libhydrogen-binding/issues
- npm.io page: https://npm.io/package/node-libhydrogen-binding

## Dependencies (2)

- [nan](https://npm.io/package/nan.md) ^2.14.0
- [node-gyp](https://npm.io/package/node-gyp.md) ^3.8.0

## Recent versions

- 0.0.3 (latest) — 2019-11-18
- 0.0.2 — 2018-06-03

## README

# **EXPERIMENTAL: node-libhydrogen-binding** #

[![Build Status](https://travis-ci.org/trampi/node-libhydrogen-binding.svg)](https://travis-ci.org/trampi/node-libhydrogen-binding)

### libhydrogen native bindings for Node.js
**Work in progress!** This package brings the easy-to-use encryption library [libhydrogen](https://github.com/jedisct1/libhydrogen/) to Node.js.  


# Usage example
Install *node-libhydrogen-binding* as any other package:
```bash
npm install node-libhydrogen-binding
```

You can use it for encrypting and decrypting payload:
```javascript
const hydrogen = require('node-libhydrogen-binding');
hydrogen.init();

const msg = "message";
const key = hydrogen.secretbox_keygen();
const msgId = 0;
const context = "testtest";

// encrypt
const ciphertext = hydrogen.secretbox_encrypt(msg, key, msgId, context);

// decrypt
const plaintext = hydrogen.secretbox_decrypt(ciphertext, key, msgId, context)
```


# [API Documentation](https://github.com/trampi/node-libhydrogen-binding/wiki)
[Check the wiki](https://github.com/trampi/node-libhydrogen-binding/wiki)

# Building
* `git submodule update --init`
* `npm install --global --production windows-build-tools` (windows only)
* `npm run build` 

# License
ISC, same as [libhydrogen](https://github.com/jedisct1/libhydrogen/).

---
_Source: https://npm.io/package/node-libhydrogen-binding · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
