bytebuffer
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/bytebuffer package

5.0.1 • Public • Published

bytebuffer.js - The swiss army knife for binary data in JavaScript.

A fast and complete ByteBuffer implementation using either ArrayBuffers in the browser or node Buffers under node.js, generated from a single source tree through MetaScript.

Build Status Donate

Features

  • Three API-compatible versions:
    • bytebuffer   Backing buffer: ArrayBuffer, Accessor: Uint8Array
    • bytebuffer-dataview   Backing buffer: ArrayBuffer, Accessor: DataView
    • bytebuffer-node   Backing buffer / Accessor: node Buffer
  • 8, 16, 32 and 64 bit (through long.js) signed and unsigned integers
  • 32 and 64 bit floats
  • Varints as used in protobuf (32 and 64 bit, zig-zag)
  • Base64, utf8, binary, hex and debug encodings
  • Handy string and debugging utilities
  • Big and little endianness
  • Relative and absolute zero-copy operations wherever possible
  • Transparent resizing when using unknown-length data
  • Chaining of all operations that do not return a specific value
  • Slicing, appending, prepending, reversing, flip, mark, reset, etc.

Usage

The library is compatible with CommonJS and AMD loaders and is exposed globally as dcodeIO.ByteBuffer if neither is available.

var ByteBuffer = require("bytebuffer");
 
var bb = new ByteBuffer()
            .writeIString("Hello world!")
            .flip();
console.log(bb.readIString()+" from bytebuffer.js");

In the browser, 64 bit integer support is optional and present only if Long.js has been loaded prior to bytebuffer.js.

API

Downloads

Support for IE<10, FF<15, Chrome<9 etc.

  • Use bytebuffer-dataview with a polyfill (see)

Contributors

Dretch (IE8 compatibility)

License

License: Apache License, Version 2.0 - Logo derived from W3C HTML5 Logos (CC A 3.0)

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
5.0.1254,564latest

Version History

VersionDownloads (Last 7 Days)Published
5.0.1254,564
5.0.021
4.1.0656
4.0.03
3.5.52,423
3.5.4107
3.5.33
3.5.20
3.5.15
3.5.01
3.4.04
3.3.03
3.2.30
3.2.20
3.2.10
3.2.00
2.3.272
3.1.1-11
3.1.120
3.1.01
3.0.30
3.0.25
3.0.10
3.0.03
3.0.0-RC20
3.0.0-RC10
2.3.181
2.3.02
2.2.00
2.1.13
2.1.01
2.0.23
2.0.10
2.0.07
1.6.11
1.6.02
1.5.01
1.4.10
1.3.81
1.3.70
1.3.60
1.3.50
1.3.40
1.3.30
1.3.22
1.3.12
1.3.02
1.2.30
1.2.21
1.2.10
1.2.00
1.1.50
1.1.40
1.1.30
1.1.20
1.1.11
1.1.06
1.0.52
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00
0.9.40
0.9.30
0.9.11
0.9.00
0.0.00

Package Sidebar

Install

npm i bytebuffer

Weekly Downloads

258,011

Version

5.0.1

License

Apache-2.0

Last publish

Collaborators

  • dcode