Buffers in pure js