Replies: 7 comments
-
不如弄个BinaryEncoder/BinaryDecoder,其中可以为hex或者base64,以及其他扩展格式 |
Beta Was this translation helpful? Give feedback.
-
就 https://mdn.io/TextEncoder / https://mdn.io/TextDecoder 来说并不具备任何扩展意义 当然如果 BinaryEncoder / BinaryDecoder 从设计上具备扩展意义 建构在 ArrayBuffer 基础上,也是可以方便未来将其推广到 TypedArray 之上 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
我参考的是 Node.js 的 Buffer.compare 设计 |
Beta Was this translation helpful? Give feedback.
-
我就是不太清楚对 buffer 进行 sort 是有什么使用场景。也许经常搞 node 的同学知道。 |
Beta Was this translation helpful? Give feedback.
-
base64现在已经有提案了,不过是在Uint8Array上。(其实顶楼建议的这些方法都应该在TypedArray而不是在ArrayBuffer上。) |
Beta Was this translation helpful? Give feedback.
-
atob
/btoa
不在 ES 规范中Beta Was this translation helpful? Give feedback.
All reactions