Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Drop support for offset argument, commit to Uint8Array type for binary uuids #756

Closed
broofa opened this issue Jun 4, 2024 · 1 comment
Closed

Comments

@broofa
Copy link
Member

broofa commented Jun 4, 2024

The offset argument is a relic from before Uint8Array and ArrayBuffer types were widespread. Now that those types are widely adopted, users can create typed arrays with built-in offsets, obviating the need for us to support typed arrays. For example...

const arr1 = new Uint8Array(1024);
const arr2 = new Uint8Array(arr1.buffer, 16);
arr2[0] = 123;
console.log(arr1[16]); // <-- "123"

This assumes we commit to Uint8Array for binary uuid types, however. See #755

This would be a breaking change, of course.

@broofa broofa changed the title BREAKING CHANGE: Drop support for offset argument, commit to Uint8Array type for binary uuids Drop support for offset argument, commit to Uint8Array type for binary uuids Jun 5, 2024
@broofa
Copy link
Member Author

broofa commented Jul 22, 2024

Closing. In light of recent v11 work, I just don't think it's worth the API disruption at this time.

@broofa broofa closed this as completed Jul 22, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant