Skip to content

estarriolvetch/solidity-bits

Repository files navigation

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