stringencoding
Encode to/from Typed Array buffers
Last updated 8 years ago by shtylman .
Apache License 2.0 · Repository · Original npm · Tarball · package.json
$ cnpm install stringencoding 
SYNC missed versions from official npm registry.

stringencoding

basic usage

// encode a string into a typed array given an encoding
var uint8array = TextEncoder(encoding).encode(string);

// decode typed array into a string
var string = TextDecoder(encoding).decode(uint8array);

streaming decode

var string = '';
var decoder = TextDecoder(encoding), buffer;

while (buffer = next_chunk()) {
    string += decoder.decode(buffer, { stream:true });
}

string += decoder.decode(); // finish the stream

install

npm install stringencoding

Current Tags

  • 0.0.0                                ...           latest (8 years ago)

1 Versions

  • 0.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |