Giter Club home page Giter Club logo

binrange's Introduction

What's this? Build Status

binrange is a library to parse and emit over ranges of ubyte.

It's an alternative to std.bitmanip.read and std.bitmanip.write. It also support RIFF headers.

Licenses

See UNLICENSE.txt

Usage

import binrange;

void main()
{
    ubyte[] input = [ 0x00, 0x01, 0x02, 0x03 ];

    // read one uint encoded in little endian from a range
    assert(popLE!uint(input) == 0x03020100);

    // write one float encoded in big-endian into an output range
    import std.array;
    ubyte[] arr;
    auto app = appender(arr);
    writeBE!float(app, 1.2f);
}

binrange's People

Contributors

martinnowak avatar o3o avatar p0nce avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

martinnowak

binrange's Issues

Module name question

Hi,
I 've seen that you've changed the your module name to package.d

But package is standard name that provides a way to import a package.
Maybe old name is better...what do you think?

Example typo

First of all thank you for your code.

So, maybe on Readme Usage:

ubyte[] arr;
auto app = appender(arr2);
writeBE!float(app, 1.2f);

should be:

ubyte[] arr2; //<-- typo
auto app = appender(arr2);
writeBE!float(app, 1.2f);

Error on popLE double

This test fail:

unittest
{
    ubyte[] arr = [0, 0, 0, 0, 0, 0, 0xe0, 0x3f];
    assert(popLE!double(arr) == 0.5);
    arr = [0, 0, 0, 0, 0, 0, 0xe0, 0xbf];
    assert(popLE!double(arr) == -0.5);
} 

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.