# bc-bip68

> A BIP68 relative lock-time encoding library.

Latest version **1.0.5** (published 2018-11-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install bc-bip68
pnpm add bc-bip68
yarn add bc-bip68
bun add bc-bip68
```

## 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.5 |
| Published | 2018-11-27 |
| First published | 2018-11-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.5.0 |
| Dependencies | 0 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Daniel Cousens |
| Maintainers | gabriel.cardona |
| Keywords | bip68, htlc, csv, checksequenceverify, OP_CHECKSEQUENCEVERIFY, OP_CSV, bitcoin |

## Links

- npm: https://www.npmjs.com/package/bc-bip68
- Repository: https://github.com/bitcoinjs/bip68
- Issues: https://github.com/bitcoinjs/bip68/issues
- npm.io page: https://npm.io/package/bc-bip68

## Alternatives

- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads
- [@1selfworld/adchain-sdk-react-native](https://npm.io/package/@1selfworld/adchain-sdk-react-native.md) — 80 weekly downloads

## Recent versions

- 1.0.5 (latest) — 2018-11-27

## README

# bip68
[![NPM Package](https://img.shields.io/npm/v/bip68.svg?style=flat-square)](https://www.npmjs.org/package/bip68)
[![Build Status](https://img.shields.io/travis/bitcoinjs/bip68.svg?branch=master&style=flat-square)](https://travis-ci.org/bitcoinjs/bip68)
[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)

A [BIP68](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki) relative lock-time encoding library.


## Example
``` javascript
let bip68 = require('bip68')

bip68.encode({ seconds: 2048 })
// => 0x00400004

bip68.encode({ seconds: 102 })
// => TypeError: Expected Number seconds as a multiple of 512 (as per the BIP)

bip68.encode({ blocks: 54 })
// => 0x00000036

bip68.encode({ blocks: 200 })
// => 0x000000c8

bip68.decode(0x03ffffff)
// => { seconds: 33553920 }

bip68.decode(0x0100fffe) // safely ignores extension bits
// => { blocks: 65534 }

bip68.decode(0xffffffff) // final sequence
// => {}
```


## LICENSE [ISC](LICENSE)

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