New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bip68

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bip68

A BIP68 relative lock-time encoding library.

1.0.4
latest
Source
npm
Version published
Weekly downloads
7.6K
-20.68%
Maintainers
3
Weekly downloads
 
Created
Source

bip68

NPM Package Build Status js-standard-style

A BIP68 relative lock-time encoding library.

Example

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

Keywords

bip68

FAQs

Package last updated on 01 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts