Files
common/packages/util/README.md
T
Jaco Greeff b5c5734c7c Add Blake2s & XXHash utility functions (#66)
* Initial split of util & util-crypto

* Add initial XXHash version

* Blake2s wit tests & documentation

* Add sha512 (from NaCl)

* Add randomBytes (from NaCl)

* Flow fixes

* Update documentation

* Update latest @polkadot/dev
2018-01-25 14:13:43 +01:00

38 lines
1.9 KiB
Markdown

[![polkadotjs](https://img.shields.io/badge/polkadot-js-orange.svg?style=flat-square)](https://polkadot.js.org)
![isc](https://img.shields.io/badge/license-ISC-lightgrey.svg?style=flat-square)
[![style](https://img.shields.io/badge/code%20style-semistandard-lightgrey.svg?style=flat-square)](https://github.com/Flet/semistandard)
[![npm](https://img.shields.io/npm/v/@polkadot/util.svg?style=flat-square)](https://www.npmjs.com/package/@polkadot/util)
[![travis](https://img.shields.io/travis/polkadot-js/util.svg?style=flat-square)](https://travis-ci.org/polkadot-js/util)
[![maintainability](https://img.shields.io/codeclimate/maintainability/polkadot-js/util.svg?style=flat-square)](https://codeclimate.com/github/polkadot-js/util/maintainability)
[![coverage](https://img.shields.io/coveralls/polkadot-js/util.svg?style=flat-square)](https://coveralls.io/github/polkadot-js/util?branch=master)
[![dependency](https://david-dm.org/polkadot-js/util.svg?style=flat-square&path=packages/util)](https://david-dm.org/polkadot-js/util?path=packages/util)
[![devDependency](https://david-dm.org/polkadot-js/util/dev-status.svg?style=flat-square&path=packages/util)](https://david-dm.org/polkadot-js/util?path=packages/util#info=devDependencies)
# @polkadot/util
Various useful utility functions that are used across all projects in the [@polkadot](https://polkadot.js.org) namespace. It provides utility functions with additional safety checks, allowing not only for consistent coding, but also reducing the general boilerplate.
## Usage
Installation -
```
npm install --save @polkadot/util
```
Functions can be imported directly from the package, e.g.
```js
import { isHex } from '@polkadot/util';
```
Alternatively the function can be accessed directly,
```js
import isHex from '@polkadot/util/is/hex';
```
## Available Utilities
For a list of currently exposed methods, see the [library documentation](docs/README.md).