binary-tools.js

  • Support bfloat16, float16 and more
  • Support integers from 8 to 1024-bit and more
  • Support UTF-8, UTF-16 and UTF-32 strings
  • Zero dependencies
↪ Get the source code ↪ Run the browser tests

Dealing with bytes should be a pleasure.

binary-tools.js eases the task of dealing with raw binary data by using a simple interface built upon conventions you are likely to be already familiar with and a extensive list of real-world types. No need to tweak standard libraries to suit your needs, no need to expend your time wandering if your approach was the right one - the types and functions you need are already here by default.

Free in the true sense of free software.

This software is available under a range of open-source licenses - meaning that after buying it you can have full access to its source code and deal with it with all the freedom granted by those licenses, including developing it yourself and sharing your work with the world. I'm proud of everyone using my software, and I'm proud to give my customers the best experience both in the software itself and in the support I give for them.

Tailored for real life use cases.

Using typed arrays for parsing binary data may be good for reading and writing a few bytes, but if you are working with serious software that handle lots of data on time-critical missions you need more than that. binary-tools.js is built for safety and speed, with a API that suits both reading and writing a few bytes of structured data or huge streams of bytes, as in the case of media files, cryptography or AI applications.

Not just your vanilla 16-bit integers.

Real life applications need way more than the common types supported by standard libraries - binary-tools.js have native support for huge integers commonly used in cryptography, not-so-common types used in media files, novel data types used in AI development and cryptic types used on legacy software and hardware - all using the same codebase. It is a practical tool built upon theoretical knowledge of computer science that is by itself agnostic to programming languages or environments. This is why it supports nearly any type, this is why it works in any JavaScript runtime, and this is why it is safe and extensible. It works great in your software, and is also a powerful tool to keep in your toolbox for the years to come.

It works everywhere.

While the source code of this software is developed using the latest patterns and features of present-day JavaScript, it is built so that it may be compiled/transpiled to work in any environment with JavaScript support, including extremely outdated engines like IE6. To make it more flexible, it is available by default as both ES3/CommonJS and a modern JavaScript module so you can choose which version better suits your needs. Both distributions and all features are accessible in both the free and paid versions.

No black-box approach.

binary-tools.js relies on standard math (and some bit shifting) to perform all of its operations. It is blazing fast, safe, and best of all, clear on its approach to reading and writing binary data. All parsers for the supported types (integers, BigInts, floating point numbers, single-byte character encodings, UTF-8, UTF-16 and UTF-32 strings) are stand-alone classes that perform their tasks using clear language, well defined steps and very little language-specific features (or none at all), meaning that you can always be absolutely sure about whats going on under the hood, and also that porting any of its functionality to other languages or environments, for example, should be as easy as copying, pasting and changing the syntax.

Tested to exhaustion.

There is no such thing as "enough" when it comes to testing. No release comes until the source code is 100% tested - lines, functions, branches, everything must be 100%. And when 100% test coverage is reached, I'll write some more. Actually, a lot more. If I'm able to test all possible values, I do it. If I'm not able to test all possible inputs, I'll sample the most values I can, always using diverse and reliable sources. Adding tests is a continuous process, and if a bug is found (usually interface-related), I'm proud to show both the bug and the bugfix to the world.




The fastest binary parser for JavaScript.

LGPL version available

binary-tools: JavaScript binary tools for any browser or environment.
Copyright (C) 2023 Rafael da Silva Rocha

This software is released under the Creative Commons CC-BY-NC-ND-4.0 license (very restrictive, no commercial use). You may purchase a version of this software released under the LGPL for your freedom and convenience.

For commercial use:

  • Buy now: $10.00  | CC-BY-ND-4.0

    No sources included, licensed as CC-BY-ND-4.0 for commercial use.

Full source code:

  • Buy now: $40.00  | GPL

    Comes multi-licensed with GPL-2.0 and GPL-3.0

  • Buy now: $80.00  | LGPL

    Comes multi-licensed with LGPL-2.1, LGPL-3.0, MPL-2.0 and GPLs

Multi-licensing ensures that you can choose the license that works best for you.

Payment:

copy PayPal: [email protected] copy PIX: [email protected]

The prices are just for reference. You may use your own currency to pay me as long as the value is similar to the reference price. I accept some cryptocurrencies. If you have any doubt or are having trouble with the payment methods listed above, email me at [email protected] and we will find a solution. You don't need to worry about the precise exchange rate for the day :)

Please contact me at [email protected] informing your payment method and date. You don't have to wait for a response to make your purchase, just let me know what you're buying and the origin of the transfer.

You will receive a download link as soon as I confirm your payment.

Licenses apply to specific versions. That said, after your first purchase, I'll be happy to send you any updates at your request, free of charge.

Last reviewed in 2023-09-23


Talk to me: [email protected]

I may be available to work on your project.