Socket
Socket
Sign inDemoInstall

bitcoin-util

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitcoin-util

Utility functions for Bitcoin hashes and targets


Version published
Weekly downloads
53
decreased by-39.08%
Maintainers
1
Weekly downloads
 
Created
Source

bitcoin-util

npm version Build Status Dependency Status

Utility functions for Bitcoin hashes and targets

Usage

npm install bitcoin-util

Methods

toHash(hex)

Takes a hex string that contains a Bitcoin hash as input, and returns a Bitcoin-protocol-friendly Big-endian Buffer. Throws an error if the hex string is not of length 64 (representing a 256-bit hash).

toCompactTarget(n)

Converts the difficulty target n to its compact representation (used in the "bits" field in block headers). n can be a Buffer, hex string, or BN (from the bn.js package).

NOTE

bitcoin-util uses the buffertools package as a dependency, which is a compiled native module. When browserifying, the browserify-buffertools package will be used instead (to keep browser compatibility).

Keywords

FAQs

Package last updated on 21 Jan 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc