Awesome
bitcoin-spv-utils
API
bits2buf(Number bits)
buf2bits(Buffer buf)
getMaxTarget()
getTarget(Buffer first, Buffer last)
verifyHeader(Buffer header, Buffer previous, Object target [, Boolean isTestnet = false])
verifyHeaders(Buffer[] headers, Buffer previous, Object target [, Boolean isTestnet = false]
#####bits2buf(Number bits)
-> Buffer
Unpack bits.
#####buf2bits(Buffer buf)
-> Number
Pack bits.
#####getMaxTarget()
-> {bits: Number, buf: Buffer}
Return max target. (bits -- 0x1d00ffff, hex -- 00000000ffff0000000000000000000000000000000000000000000000000000)
#####getTarget(Buffer first, Buffer last)
-> {bits: Number, buf: Buffer}
Calculate target of next chunk.
#####verifyHeader(Buffer header, ?Buffer previous, Object target [, Boolean isTestnet = false])
-> Boolean
Verify given header.
#####verifyHeaders(Buffer[] headers, ?Buffer previous, Object target [, Boolean isTestnet = false]
-> Boolean
Verify given headers.
License
This software is licensed under the MIT License.