# bottos-js-crypto

> crypto for bottos wallet project

Latest version **1.0.15** (published 2019-01-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install bottos-js-crypto
pnpm add bottos-js-crypto
yarn add bottos-js-crypto
bun add bottos-js-crypto
```

## 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.15 |
| Published | 2019-01-16 |
| First published | 2018-05-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 415.6 KB |
| Known vulnerabilities | 0 (+14 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | yuanjunliang |
| Maintainers | yuanjunliang |

## Links

- npm: https://www.npmjs.com/package/bottos-js-crypto
- Repository: https://github.com/bottos-project/bottos-js-crypto
- Homepage: https://github.com/bottos-project/bottos-js-crypto#readme
- Issues: https://github.com/bottos-project/bottos-js-crypto/issues
- npm.io page: https://npm.io/package/bottos-js-crypto

## Dependencies (10)

- [long](https://npm.io/package/long.md) ^4.0.0
- [uuid](https://npm.io/package/uuid.md) ^3.2.1
- [keccak](https://npm.io/package/keccak.md) ^1.4.0
- [eccrypto](https://npm.io/package/eccrypto.md) ^1.0.3
- [crypto-js](https://npm.io/package/crypto-js.md) ^3.1.9-1
- [secp256k1](https://npm.io/package/secp256k1.md) ^3.5.0
- [bytebuffer](https://npm.io/package/bytebuffer.md) ^5.0.1
- [protobufjs](https://npm.io/package/protobufjs.md) ^6.8.6
- [bignumber.js](https://npm.io/package/bignumber.js.md) ^8.0.1
- [google-protobuf](https://npm.io/package/google-protobuf.md) ^3.5.0

## Recent versions

- 1.0.15 (latest) — 2019-01-16
- 1.0.14 — 2019-01-14
- 1.0.13 — 2019-01-14
- 1.0.12 — 2018-05-11
- 1.0.11 — 2018-05-11
- 1.0.10 — 2018-05-11
- 1.0.9 — 2018-05-10
- 1.0.8 — 2018-05-10
- 1.0.7 — 2018-05-10
- 1.0.6 — 2018-05-10
- 1.0.5 — 2018-05-08
- 1.0.4 — 2018-05-08
- 1.0.3 — 2018-05-08
- 1.0.2 — 2018-05-08
- 1.0.1 — 2018-05-08
- … 1 more at https://npm.io/package/bottos-js-crypto/versions

## README

# btocomponent
   
   wallet and client component repository


# wallet component

   

# public component


# Usage

```
const btcrypto = require('bottos-js-crypto')

// create public key and private key
let keys = btcrypto.createPubPrivateKeys()

//  sign message
let prikey = keys.privateKey
let awesome = require('./awesome_pb')
let msg =  {"version":22,"cursornum":123,"cursor_label":888,"lifetime":124,"sender":"22", "contract":"", "method":"4", "param":[123,34,102,114,111,109,34,58,34,100,101,108,101,103,97,116,101,49,34,44,34,116,111,34,58,34,100,101,108,101,103,97,116,101,50,34,44,34,118,97,108,117,101,34,58,49,48,48,48,48,125], "sig_alg":0, "signature":[]}
let encodeBuf = btcrypto.protobufEncode(awesome,msg)
let hashData = btcrypto.sha256(btcrypto.buf2hex(encodeBuf))
let sign = btcrypto.sign(hashData,prikey)

// // sha256
let hash = btcrypto.sha256("test message")

// keystore
let kst = btcrypto.keystore;
let keystoreObj = kst.create({account:"john",password:"john123"})


// keystore and password decrypto private key
let privateKey = keystore.recover(password,keystoreObj)


```

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