matter.js
matter.js copied to clipboard
Trivial: ByteArray thoughts
Some quick ideas r.e. ByteArray.
- Right now we monkeypatch Uint8Array, might be frowned upon by some library users
- Could we make ByteArray a subclass of Uint8Array instead of an alias, and put utility functions there?
- We could also add custom toString and toJSON methods so diagnostics like in #138 would show as hex rather than comma-separated decimal
- I could also add the base64 utilities using the codec I made for the security stuff
@mfucci introduced it that way. I think the idea was that on other platforms it might nbe something else then UInt8Array, thats why "just" the alias.
@mfucci Any opinion on this?