1.0.4 • Published 1 year ago

bitope v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Library for Solidity bit operation

Why

Solidity for easy bit operations!

How to Use

Import into YourContracts

npm i bitope

or

yarn bitope

using

import { BitOpe } from 'BitOpe.sol';
using BitOpe for uint256;
using BitOpe for uint64;

access

uint256 testval,res;
testval = testval.set128(0,123);
testval = testval.set128(1,456);
res = testval.get128(0);    // res = 123
res = testval.get128(1);    // res = 456

Functions

for uint256

bitpacksmax vaslue
1282340,282,366,920,938,463,463,374,607,431,768,211,455
64418,446,744,073,709,551,615
3284,294,967,295
161665,535
832255

for uint64

bitpacksmax vaslue
3224,294,967,295
16465,535
88255