Skip to content

kirilloid/bzip2-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

str argument should be a binary-string like result of readAsBinaryString from HTML5 FileAPI
Actually, javascript implementations uses utf-16(LE) for internal representation of strings
if you want to transfer data over http, keep in mind encoding, used at your server
for example, if you use bzcompress in php, it will return iso-latin-1 encoded string
and if your server uses utf-8, you'll need to utf8_encode result before output
or set proper encoding http header
Moreover, if you transfer bzipped utf8 texts, you'll need to transform the result of bzip2-decoding in js
Even though escape/unesapce functions are considered deprecated, I would advise the following code
function utf8_decode(str) { return decodeURIComponent(escape(str)); }
cause it have most balanced execution time across different browsers and input strings

About

JavaScript bzip2 implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published