Login   Register  
PHP Classes

Bitmask Magic: Generate bitmasks for storing options.

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

  Author Author  
Picture of Timm Simpkins
Name: Timm Simpkins <e-mail contact>
Packages: 1 Browse all classes by Timm Simpkins Browse all classes by
Country: United States United States - PHP jobs in United States
Age: 40
All time rank: 2220281 in United States United States
Week rank: 2008 Up231 in United States United States Up

  Detailed description   Download Download .zip .tar.gz  
This class is designed to create bitmasks, which are very commonly used to store lists of true or false values as a single integer.

The class can manpulate bitmasks that are not limited to 32 bits. It does not need the PHP gmp extension to provide arbitrary bit length support.

This absence of limits may encourage the storage of more complex data than merely true or false lists for those that are creative enough to figure it out.

Although PHP programmers commonly rely on databases to do much of the grunt work that is most commonly done by bitmasks in other types of programming, there is nothing better for tracking things such as user permissions, product options, and I have even used them to trace complex data structures.


- Convert arrays of booleans to bitmasks

- Convert bitmasks to booleans

- Convert bitmasks to arrays of booleans

- Store virtually unlimited bit depth bitmasks in string form

- Query individual bits to see if they are set

- Enter an associative array, manipulate bits and return the array in either the full array or only the values that are set

  Classes of Timm Simpkins  >  Bitmask Magic  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: Bitmask Magic
Base name: bitmask
Description: Generate bitmasks for storing options.
Version: -
PHP version: -
License: Public Domain
All time users: 900 users
All time rank: 3587
Week users: 0 users
Week rank: 2464 Equal
  Groups   Rate classes User ratings   Applications   Files Files  

Group folder image Math Math related classes. View top rated classes

  User ratings  
There are not enough user ratings to display for this class.

  Applications that use this class  
No application links were specified for this class.
Add link image If you know an application of this package, send a message to the author to add a link here.
  Files folder image Files  
File Role Description
Plain text file bitmask.class.php Class bitmask class
Accessible without login Plain text file bitmask_example.php Example Example file for bitmask class

Download Download all files: bitmask.tar.gz bitmask.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.