1.0.2 • Published 2 years ago

screw-amaury v1.0.2

Weekly downloads
-
License
Open BSV License
Repository
github
Last release
2 years ago

screw-amaury

Mitigations for Amaury minimal-encoding issues

The code is hosted on GitHub and the package is available through NPM.

Installation

npm i screw-amaury

Example Usage

const screw = require('screw-amaury')

// Convert stack elements to minimal encoding
const unscrewed1 = screw(Buffer.from('00'))
const unscrewed2 = screw(Buffer.from('01'))
const unscrewed3 = screw(Buffer.from('0f'))
const screwedBCH = screw(Buffer.from('deadbeef20181115'))

API

Table of Contents

index

Given a Buffer as an input, returns a minimally-encoded version as a hex string, plus any pushdata that may be required.

Parameters

  • buf NodeJS Buffer containing an intended Bitcoin script stack element

Returns String Minimally-encoded version, plus the correct opcodes required to push it with minimal encoding, if any, in hex string format.

License

The license for the code in this repository is the Open BSV License.