Skip to content

defunctzombie/stringencoding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stringencoding Build Status

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

About

Encode to/from Typed Array buffers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published