Giter Club home page Giter Club logo

node-jspack's Issues

Unpacking on Web

Hello, I wanted to know if this package works on web.

I've tried using it on node.js and it worked just fine, but when I got to use it on web, the values that were supposed to be int came as NaN.

not packing 'signed long'

I'm hoping this is user error but I am not getting expected results trying to pack a signed long (8 byte integer), my test case value is 579. From the documentation, I assume 'q' is the correct format, and I'm working in Big Endian. My "other" program gives me [0, 0, 0, 0, 0, 0, 2, 67]. using 'i', 'I', 'l' and 'L' I get [0, 0, 2, 67] as expected, however using the 8 byte formats I just get zeros...

console.log("pack >i 579", jspack.Pack(">i", [579]));
console.log("pack >I 579", jspack.Pack(">I", [579]));
console.log("pack >l 579", jspack.Pack(">l", [579]));
console.log("pack >L 579", jspack.Pack(">L", [579]));
console.log("pack >q 579", jspack.Pack(">q", [579]));
console.log("pack <q 579", jspack.Pack("<q", [579]));
console.log("pack >Q 579", jspack.Pack(">Q", [579]));
console.log("pack >f 579", jspack.Pack(">f", [579]));
console.log("pack >d 579", jspack.Pack(">d", [579]));

output:

pack >i 579 (4) [0, 0, 2, 67]
pack >I 579 (4) [0, 0, 2, 67]
pack >l 579 (4) [0, 0, 2, 67]
pack >L 579 (4) [0, 0, 2, 67]
pack >q 579 (8) [0, 0, 0, 0, 0, 0, 0, 0]
pack <q 579 (8) [0, 0, 0, 0, 0, 0, 0, 0]
pack >Q 579 (8) [0, 0, 0, 0, 0, 0, 0, 0]
pack >f 579 (4) [68, 16, 192, 0]
pack >d 579 (8) [64, 130, 24, 0, 0, 0, 0, 0]

is this a bug or am i doing it wrong?

Regex Issue

You have used the regex as
m._sPattern = '(\\d + )?([AxcbBhHsfdiIlLqQ])'
I think there shouldn't be a space in either direction of "+". I think it should be
m._sPattern = '(\\d+)?([AxcbBhHsfdiIlLqQ])';
Let me know if I am wrong

support long long datatypes

I noticed that this project is missing a few format strings that python supports - most notably, long long

I also noticed that NeoXiD has this support in his fork.
Since @NeoXiD doesn't support issues, and I saw on pgriess#2 that this fork is the one currently in npm, I was hoping you could merge @NeoXiD's changes and re-publish.

Let me know your thoughts

Slightly confusing readme

'A format character may be preceded by an integral repeat count. For example, the format string "4h" means exactly the same thing as "hhhh".'

Does that mean we can use either or does it mean we have to split stuff like 4B into BBBB. @kmpm

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.