# @twala-io/twala-util

> A collection of utility functions for Twala.

Latest version **1.0.7** (published 2020-06-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @twala-io/twala-util
pnpm add @twala-io/twala-util
yarn add @twala-io/twala-util
bun add @twala-io/twala-util
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2020-06-04 |
| First published | 2020-04-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 39.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Twala |
| Maintainers | apquinit, edilsalvador |
| Keywords | twala, utils |

## Links

- npm: https://www.npmjs.com/package/@twala-io/twala-util
- Repository: https://github.com/twala-io/twala-util
- Homepage: https://github.com/twala-io/twala-util#readme
- Issues: https://github.com/twala-io/twala-util/issues
- npm.io page: https://npm.io/package/@twala-io/twala-util

## Dependencies (1)

- [web3](https://npm.io/package/web3.md) ^1.2.6

## Recent versions

- 1.0.7 (latest) — 2020-06-04
- 1.0.6 — 2020-04-28
- 1.0.5 — 2020-04-24
- 1.0.4 — 2020-04-23
- 1.0.3 — 2020-04-23
- 1.0.2 — 2020-04-22
- 1.0.1 — 2020-04-22
- 1.0.0 — 2020-04-22

## README

# Twala Util

A collection of utility functions for Twala.

![Node.js CI](https://github.com/twala-io/twala-util/workflows/Node.js%20CI/badge.svg)
[![Version](https://img.shields.io/npm/v/@twala-io/twala-util.svg)](https://npmjs.org/package/@twala-io/twala-util)
[![Downloads/week](https://img.shields.io/npm/dw/@twala-io/twala-util.svg)](https://npmjs.org/package/@twala-io/twala-util)
[![License](https://img.shields.io/npm/l/@twala-io/twala-util.svg)](https://github.com/twala-io/twala-util/blob/master/package.json)

## Features

* Generate signature
```js
const TwalaUtil = require('@twala-io/twala-util')
const util = new TwalaUtil(web3Provider)
const signature = util.sign('sample data', privateKey)
```

* Verify signature
```js
const TwalaUtil = require('@twala-io/twala-util')
const util = new TwalaUtil(web3Provider)
const isSigned = await util.isSigned(address, messageHash, v, r, s)
```

* Recover address
```js
const TwalaUtil = require('@twala-io/twala-util')
const util = new TwalaUtil(web3Provider)
const address = await util.recoverAddress(messageHash, v, r, s)
```

* Convert ASCII to Hex
```js
const TwalaUtil = require('@twala-io/twala-util')
const util = new TwalaUtil(web3Provider)
const hex = util.convertAsciiToHex(ascii)
```

* Convert Hex to ASCII
```js
const TwalaUtil = require('@twala-io/twala-util')
const util = new TwalaUtil(web3Provider)
const ascii = util.convertHexToAscii(hex)
```

* Get Keccak-256 hash
```js
const TwalaUtil = require('@twala-io/twala-util')
const util = new TwalaUtil(web3Provider)
const hash = util.computeHash(string)
```

## Installation

```sh-session
$ npm i @twala-io/twala-util
```

## Contributing

Keep it simple. Keep it minimal. Don't put every single feature just because you can.

## Author

* Alexander Paul P. Quinit

## License

This project is licensed under the GNU General Public License v3.0.

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