solidity-bits

0.4.0 • Public • Published

solidity-bits

Test Publish Package to npmjs npm version

This library provides useful tools for bit tricks with solidity and gas-efficient data sturctures powered by these bit tricks.

  • BitScan: Powered by de Bruijn sequence, this library provides gas efficient functions to find the index of the least and most significant set bits. It can also be used for efficiently calculating the log2 of a value.
  • Popcount: Calculate the number of 1 bits of an unsigned integer.
  • BitMaps: A modified Openzeppelin's BitMaps library with additional functions to efficiently find the closest set bit.

Installaion

npm

npm install --save-dev solidity-bits

yarn

yarn add --dev solidity-bits

Projects powered by solidity-bits

Contributor

/solidity-bits/

    Package Sidebar

    Install

    npm i solidity-bits

    Weekly Downloads

    1,489

    Version

    0.4.0

    License

    MIT

    Unpacked Size

    33.7 kB

    Total Files

    21

    Last publish

    Collaborators

    • estarriol.vetch