Convert between Uint8Array and Buffer without memory copy in Browserify.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
fastcopy.js
package.json
readme.md
uint8.js

readme.md

browser support

This module does not work any more with Browserifty 3.x and has been deprecated. Use feross/typedarray-to-buffer as an alternative or chrisdickinson/bops as a better solution to this problem.

##Uint8

Convert between Uint8Array and Buffer without memory copy in Browserify.

Only for browserify. Do not use this module for Node.js code. Some basic stuff work but not all. Array to Buffer conversion is fast in Node so this module isn't really necessary there.

Installation

npm install uint8

Usage

var uint8 = require('uint8')

API

uint8.uint8ToBuffer(uint8Array)

Convert Uint8Array to Buffer. Also accepts ArrayBuffer and ArrayBufferView subclasses.

uint8.bufferToUint8(buffer)

Convert Buffer to Uint8Array. Fast route only possible if original buffer(or its parent) was created from with uint8ToBuffer() function. Otherwise will fallback to memory copy.