Giter Club home page Giter Club logo

js-binarypack's Introduction

Build Status

BinaryJS

We're under development!

For docs and more info http://binaryjs.com

Node binary websocket streaming made easy

Download

Server

$ npm install binaryjs

or from Git

$ git clone git://github.com/binaryjs/binaryjs.git
$ cd binaryjs
$ npm install -g

Client

<script src="http://cdn.binaryjs.com/0/binary.js"></script>

http://binaryjs.com for docs and demos

Changelog

0.2.2

  • Update js-binarypack to 0.0.9, removed unused check.

0.2.1

  • Update js-binarypack to 0.0.7, fast utf8 support now on by default.

0.2.0

  • Fix critical BinaryPack issue prevent TypedArrays of 16 bit or greater from being serialized correctly

0.1.9

  • Fix close internal socket (removing not supported code/message parameters)

0.1.8

  • Does not throw exceptions when writing on a stream with closed underlying socket
  • StreamID no longer has to be a number
  • Use newer version of node-binarypack

0.1.7

  • Fix critical bug involving drain event not firing. Bump streamws to 0.1.1

0.1.5

  • streamws version >=0.1.0 is now required
  • Streams no longer add their own listeners to error/close/drain events (fixes leaks)
  • Calls to socket.send no longer include {binary: true} or callback parameters (fixes type error in some browsers)

js-binarypack's People

Contributors

ericz avatar ghostoy avatar jcrugzz avatar lmb avatar michelle avatar michelle-stripe avatar orcaman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

js-binarypack's Issues

Fails to unpack numbers > UINT_MAX (4294967295)

Such code works:

var UINT_MAX = 4294967295;

BinaryPack.unpack(
    BinaryPack.pack(
        { number: UINT_MAX }
    )
);

This throws ( RangeError: Maximum call stack size exceeded ):

BinaryPack.unpack(
    BinaryPack.pack(
        { number: UINT_MAX + 1 }
    )
);

use of reserved word as variable name

The use of the variable name 'byte' causes google closure compiler to refuse to compile the source.

Google closure compiler exits with:

ERROR: JSC_PARSE_ERROR. Parse error. identifier is a reserved word at ./node_modules/js-binarypack/lib/binarypack.js line 111 : 6
ERROR: JSC_PARSE_ERROR. Parse error. identifier is a reserved word at ./node_modules/js-binarypack/lib/binarypack.js line 113 : 9

Attached a PR removing the use of a temporary variable entirely. #12

Invalid Integer error on Negative Infinity

Thanks so much for this helpful library!

I’m using the binarypack through peer.js to send data from the Kinect 2, using Kinect2 library, which sometimes includes negative infinity. This is causing me to get the error “Invalid Integer” repeatedly from line 400, which is slowing down my peer connection significantly. I’ve fixed it in my own code with adding this as an additional option at line 399:

else if(num===Number.NEGATIVE_INFINITY){num=0;}

In my use case setting num to 0 solves the issue. Although there's likely a better way to add a more universal fix.

Obsolete?

Since this is several years old, it seems to have missed the fact that msgpack has included distinct codes and encodings for strings and byte arrays for a while now (1). Current msgpack impls support the spec in this regard. Further, the codes used in binarypack conflict with those used in msgpack for these purposes. Should binarypack be deprecated and binaryjs made to use a current msgpack impl? Or at very least, binarypack should be made compatible with current spec.

  1. https://github.com/msgpack/msgpack/blob/master/spec.md

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.