Skip to content

deoxxa/compost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compost

Decompose and compose integers to and from lists of bits.

Overview

Need to know what bits are set in a number? Compost is here to help you out!

With Compost, you can decompose numbers into lists of bits and recompose them as easy as cake!

Usage

Also see the documentation and example.

var compost = require("./index");

// {0: true, 2: true}
console.log(compost.decompose(5));

// 5
console.log(compost.compose({0: true, 2: true}));

License

3-clause BSD. A copy is included with the source.

Contact

About

Decompose and compose integers to and from lists of bits

Resources

License

Stars

Watchers

Forks

Packages

No packages published