# bitope

> Solidity for easy bit operations!

Latest version **1.0.4** (published 2022-11-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install bitope
pnpm add bitope
yarn add bitope
bun add bitope
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2022-11-28 |
| First published | 2022-11-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 32.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | masataka-eth |

## Links

- npm: https://www.npmjs.com/package/bitope
- npm.io page: https://npm.io/package/bitope

## Recent versions

- 1.0.4 (latest) — 2022-11-28
- 1.0.3 — 2022-11-10

## README

# Library for Solidity bit operation

## Why
Solidity for easy bit operations!

## How to Use
Import into YourContracts

```console
npm i bitope
```

or


```console
yarn bitope
```

using
```Solidity
import { BitOpe } from 'BitOpe.sol';
```

```Solidity
using BitOpe for uint256;
using BitOpe for uint64;
```

access

```Solidity
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

| bit | packs | max vaslue |
|:-----------|:------------|:-------------|
|128|2|340,282,366,920,938,463,463,374,607,431,768,211,455|
|64|4|18,446,744,073,709,551,615|
|32|8|4,294,967,295|
|16|16|65,535|
|8|32|255|

### for uint64
| bit | packs | max vaslue |
|:-----------|:------------|:-------------|
|32|2|4,294,967,295|
|16|4|65,535|
|8|8|255|

---
_Source: https://npm.io/package/bitope · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
