kriszyp/cbor-x

could you maybe remove all NodeJS Buffer related stuff?

jimmywarting opened this issue · 1 comments

make it so it only rely on Uint8Array instead...

The encoder creates Buffers because they have more capabilities (that users may use), and the encoder itself uses the much faster string encoding capabilities of the Buffer (it is possible to apply Buffer methods to Uint8Array's but it is a little slower). And performance is kind of the main point of this library. Of course a Buffer is a Uint8Array (a subclass).

The decoder should accept Uint8Array instances just fine (although there is still a significant amount of NodeJS infrastructure that is leveraged, when available, to achieve optimal performance).