GitXplorerGitXplorer
c

bitcoin-buffer

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
74855ecbeb4b05a38b0a39a2092b6b8c6c7330ed

0.4.0

cczzarr committed 10 years ago
Unverified
0ede2a1502a4b71e43102b6817128cd38bfd2fda

change git repo url

cczzarr committed 10 years ago
Unverified
3cd68bb71d74f48aef80f519bafd390be8954aaa

breaking change of api: numToVarInt instead of writeVarInt

cczzarr committed 10 years ago
Unverified
044b1dcdf28b9e9a7686d6a1d273d40b56088c57

0.1.0

cczzarr committed 10 years ago
Unverified
156ca219c04f2b336b4c66c0c31f0660e3893354

writeUInt64LE, readUInt64LE, writeVarInt, readVarInt

cczzarr committed 10 years ago
Unverified
c9b6e2b0f17882ec1382f9db29a63869fb6e9f57

first commit

cczzarr committed 10 years ago

README

The README file for this repository.

Buffer functions for Bitcoin applications

Installation

`npm install bitcoin-buffer

Example

var utils = require('bitcoin-buffer')

var buf = new Buffer(8)

utils.writeUInt64LE(buf, 1, 0)
// buf = 0100000000000000

utils.writeVarInt(buf, 0xffffff, 0)
// buf = feffffff00

API

writeUInt64LE(buf, value, offset)

Writes in buf

readUInt64LE(buf, offset)

returns an integer

numToVarInt(value)

returns a Buffer

readVarInt(buf, offset)

returns an object of this format { res: value, offset: offset }