# xdb-digitalbits-base

> Low level digitalbits support library

Latest version **5.3.0** (published 2021-07-29) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install xdb-digitalbits-base
pnpm add xdb-digitalbits-base
yarn add xdb-digitalbits-base
bun add xdb-digitalbits-base
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.3.0 |
| Published | 2021-07-29 |
| First published | 2021-07-29 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 3.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | XDB Foundation |
| Maintainers | xdbfoundation |
| Keywords | digitalbits |

## Links

- npm: https://www.npmjs.com/package/xdb-digitalbits-base
- Repository: https://github.com/xdbfoundation/xdb-digitalbits-base
- Issues: https://github.com/xdbfoundation/xdb-digitalbits-base/issues
- npm.io page: https://npm.io/package/xdb-digitalbits-base

## Dependencies (9)

- [crc](https://npm.io/package/crc.md) ^3.5.0
- [js-xdr](https://npm.io/package/js-xdr.md) ^1.1.3
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [sha.js](https://npm.io/package/sha.js.md) ^2.3.6
- [gulp-cli](https://npm.io/package/gulp-cli.md) ^2.3.0
- [base32.js](https://npm.io/package/base32.js.md) ^0.1.0
- [tweetnacl](https://npm.io/package/tweetnacl.md) ^1.0.0
- [bignumber.js](https://npm.io/package/bignumber.js.md) ^4.0.0
- [sodium-native](https://npm.io/package/sodium-native.md) ^2.3.0

## Recent versions

- 5.3.0 (latest) — 2021-07-29
- 5.3.1 (testing) — 2022-02-01

## README

# JS DigitalBits Base

The xdb-digitalbits-base library is the lowest-level digitalbits helper library. It consists
of classes to read, write, hash, and sign the xdr structures that are used in
[digitalbits-core](https://github.com/xdbfoundation/DigitalBits). This is an
implementation in JavaScript that can be used on either Node.js or web browsers.

- **[API Reference](https://xdbfoundation.github.io/xdb-digitalbits-base/)**

> **Warning!** Node version of this package is using [`sodium-native`](https://www.npmjs.com/package/sodium-native) package, a native implementation of [Ed25519](https://ed25519.cr.yp.to/) in Node.js, as an [optional dependency](https://docs.npmjs.com/files/package.json#optionaldependencies).
> This means that if for any reason installation of this package fails, `xdb-digitalbits-base` will fallback to the much slower implementation contained in [`tweetnacl`](https://www.npmjs.com/package/tweetnacl).
>
> If you are using `xdb-digitalbits-base` in a browser you can ignore this. However, for production backend deployments you should definitely be using `sodium-native`.
> If `sodium-native` is successfully installed and working
> `DigitalBitsBase.FastSigning` variable will be equal `true`. Otherwise it will be
> `false`.

## Quick start

1. Install [Bundler](https://bundler.io)
2. Use node version >= 12. 

Clone repository, install dependencie, compile libs and link directory 

```shell
git clone https://github.com/xdbfoundation/xdb-digitalbits-base
cd xdb-digitalbits-base
bundle install
yarn
yarn gulp
yarn link
```

Use yarn to include xdb-digitalbits-base in your own project. Execute in root directory of your project

```shell
yarn link xdb-digitalbits-base
```

Then require/import it in your JavaScript:

```js
var DigitalBitsBase = require('xdb-digitalbits-base');
```
## Usage

For information on how to use xdb-digitalbits-base, take a look at the docs in the
[docs folder](./docs).

## Testing

To run all tests:

```shell
yarn gulp test
```

To run a specific set of tests:

```shell
yarn gulp test:node
yarn gulp test:browser
```

You can also run `yarn test` for a simpler subset of the test cases.

## Documentation

Documentation for this repo lives inside the [docs folder](./docs).


## License

xdb-digitalbits-base is licensed under an Apache-2.0 license. See the
[LICENSE](./LICENSE) file for details.

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