What is the problem this feature will solve?
Buffer.from() has many different forms, including Buffer.from(arrayBuffer[, byteOffset[, length]]) and Buffer.from(buffer).
However, Buffer.from(abv) does not exist. Depending on exact input, trying to call it with such objects results in false positives, data truncation, data corruption (e.g. double -> unsigned char), thrown TypeErrors and empty buffers.
Creating Buffer from ArrayBufferView's data in userland is extremely error-prone because Buffer.from(arrayBuffer) doesn't copy the data.
What is the feature you are proposing to solve the problem?
Adjust Buffer.from(buffer) to accept not only Buffer and Uint8Array but any ArrayBufferView or at least any TypedArray.
What alternatives have you considered?
Deprecation and removal of Buffer from core into userspace module, with prior porting all core APIs to native Uint8Array/TypedArray/ArrayBufferViews.
What is the problem this feature will solve?
Buffer.from()has many different forms, includingBuffer.from(arrayBuffer[, byteOffset[, length]])andBuffer.from(buffer).However,
Buffer.from(abv)does not exist. Depending on exact input, trying to call it with such objects results in false positives, data truncation, data corruption (e.g.double->unsigned char), thrownTypeErrors and empty buffers.Creating
BufferfromArrayBufferView's data in userland is extremely error-prone becauseBuffer.from(arrayBuffer)doesn't copy the data.What is the feature you are proposing to solve the problem?
Adjust
Buffer.from(buffer)to accept not onlyBufferandUint8Arraybut anyArrayBufferViewor at least anyTypedArray.What alternatives have you considered?
Deprecation and removal of
Bufferfrom core into userspace module, with prior porting all core APIs to nativeUint8Array/TypedArray/ArrayBufferViews.