Coder Social home page Coder Social logo

bite's Introduction

Bite

Micro utility library for doing bit-fiddling in Java.

The name "bite" is a mixture of the words "bit" and "byte", and also refers to the fact that the library itself is "bite-sized" and involves biting bit patterns into submission.

The library is made mostly as a recreational exercise and may or may not have any real usages.

Functions

The Java Language Specification defines the following four primitive integer types:

Type Width
byte 1 byte (8 bits)
short 2 bytes (16 bits)
int 4 bytes (32 bits)
long 8 bytes (64 bits)

In bite, there's a utility class for each of these types that contains functions for composing values into wider types, slicing them into narrower ones, overwriting sections of their bit pattern, etc.

Indexing

All indices are zero-based and increments from right to left.

The same rule applies when a value is interpreted as a composition of narrower ones. E.g., an int interpreted as four bytes, the zeroth byte is the right-most one etc.

Status

The library has no known bugs, but is also not very well tested.

It would also make sense to implement more common patterns.

bite's People

Contributors

bisgardo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.