🚨 Shai-Hulud Strikes Again:More than 500 packages and 700+ versions compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@dashevo/dash-util

Package Overview
Dependencies
Maintainers
11
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dashevo/dash-util

Utility functions for Dash hashes and targets

latest
Source
npmnpm
Version
2.0.3
Version published
Maintainers
11
Created
Source

dash-util

npm version Build Status Dependency Status

Utility functions for Dash hashes and targets

Usage

npm install @dashevo/dash-util

Methods

toHash(hex)

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

compressTarget(target)

Converts the difficulty target target to its compact representation (used in the "bits" field in block headers). target should be a Buffer (little-endian, the zeroes should be at the end). Returns a number.

expandTarget(bits)

Converts the compressed target integer bits to its target hash representation. Returns a Buffer.

Keywords

dash

FAQs

Package last updated on 27 Apr 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