Git Product home page Git Product logo

node-libeth's Introduction

node-libeth

Node bindings for generating Ethash Epoch context and light cache

Thanks to Paweł Bylica @chfast for original implementation.

Original implementation here

Usage

// arg1: epoch generation number. Ex: 460
var ecs = ethlib.getEpochContextBin(460) // returns string of JSON
var ec = JSON.parse(ecs)
console.log("ectx:", ec)

// Output:
/**
ectx: {
  bin: [
    '0xcc010000f92f0b008000e00300000000c0feab0600000000f5ff6501000000000000000000000000'
  ],
  lightNumItems: 733177,
  lightSize: 46923328,
  dagSize: 3003120256,
  dagNumItems: 23461877
}
**/
var lcBuf = ethlib.getLightCache() // returns Buffer [ ... ]
console.log("lc:", lcBuf)

// Output:
/**
lc: <Buffer 8f f0 f8 2f f1 4b 4d 57 d4 a1 f7 90 da 64 d3 b8 32 0b de 09 cb da 7f aa cd e0 dd 1d 0d 4b 30 14 e5 a9 11 90 2e b2 ab 3b 0b 61 76 80 c8 5e 73 ba 62 d8 ... 46923278 more bytes>
**/

node-libeth's People

Contributors

knockshore avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.