Skip to content

username1565/browser-buffer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Browser-buffer.js

An attempt at mimicing node.js's Buffer API in the browser using typed arrays. This project uses a lot of code from node.js's lib/buffer.js. This library still needs a lot of work both to get it running across the board and to clean up some of the pollution it puts on the UInt8Array prototype.

Usage:

<script src="src/browser-buffer.js" /></script>

<script>
	var value = new Buffer('test');
	console.log(value.toString());
	
	value = new Buffer('test', 'utf8');
	console.log(value.toString());
</script>

(lightly) Tested in:

  • Chrome 18 (beta) (Ubuntu)
  • Firefox 10.0.2 (Ubuntu)

Todo:

  • More string encodings
    1. hex
    2. binary
    3. base64 (possibly use btoa/atob?)
    4. ucs-2

Online Tests from /test/ folder

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 97.8%
  • HTML 2.2%