bitcoinjs/bip68

Name: bip68

Owner: BitcoinJS

Description: A BIP68 relative lock-time encoding library.

Created: 2017-11-30 05:32:35.0

Updated: 2018-05-22 09:09:35.0

Pushed: 2018-05-22 09:09:34.0

Homepage:

Size: 11

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

bip68

NPM Package Build Status js-standard-style

A BIP68 relative lock-time encoding library.

Example
bip68 = require('bip68')

8.encode({ seconds: 2048 })
> 0x00400004

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

8.encode({ blocks: 54 })
> 0x00000036

8.encode({ blocks: 200 })
> 0x000000c8

8.decode(0x03ffffff)
> { seconds: 33553920 }

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

8.decode(0xffffffff) // final sequence
> {}
LICENSE ISC

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.