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
Size: 11
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A BIP68 relative lock-time encoding library.
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
> {}