[info] Dart Port of XXH3 #702

Closed
opened 2022-04-20 15:05:31 -05:00 by SamJakob · 1 comment
SamJakob commented 2022-04-20 15:05:31 -05:00 (Migrated from github.com)

Hey,
I was impressed by XXH3's performance metrics and it had all the right attributes for a project I was working on... but there was no Dart version (of it or any other xxHashes) so I went ahead and made a Dart port of it.
https://pub.dev/packages/xxh3
https://github.com/SamJakob/xxh3

I might look at porting xxHash32 and 64 or making native bindings for them, but as XXH3 seemed pretty perfect for my use case I more or less stopped looking there.

If anyone with some experience with Dart (or just hashing) wouldn't mind taking a look at the project that'd be cool! I don't have too much experience with implementing hashing algorithms and mostly worked from the constexpr libary here:
https://github.com/chys87/constexpr-xxh3

I also need to add unit tests to the package but as far as code coverage I've tested most of it so it should be good to go.

Edit: now unit tested with full code coverage. Just released v1.0.0 on pub.dev.


For those that are interested - the reason I made a port and not a dart:ffi (foreign function interface) binding:

Dart can call C libraries but the key reason I selected Dart for the project is its portability and unfortunately Dart's ffi for C-interop doesn't seem to work as effortlessly as I'd like across the board (in Flutter mobile apps and desktop). However, this package should at the very least serve as a good fallback and base for building platform-specific bindings should that be desired in future.

Hey, I was impressed by XXH3's performance metrics and it had all the right attributes for a project I was working on... but there was no Dart version (of it or any other xxHashes) so I went ahead and made a Dart port of it. https://pub.dev/packages/xxh3 https://github.com/SamJakob/xxh3 I might look at porting xxHash32 and 64 or making native bindings for them, but as XXH3 seemed pretty perfect for my use case I more or less stopped looking there. If anyone with some experience with Dart (or just hashing) wouldn't mind taking a look at the project that'd be cool! I don't have too much experience with implementing hashing algorithms and mostly worked from the constexpr libary here: https://github.com/chys87/constexpr-xxh3 I also need to add unit tests to the package but as far as code coverage I've tested most of it so it should be good to go. > **Edit:** now unit tested with full code coverage. Just released v1.0.0 on pub.dev. --- For those that are interested - the reason I made a port and not a `dart:ffi` (foreign function interface) binding: Dart can call C libraries but the key reason I selected Dart for the project is its portability and unfortunately Dart's `ffi` for C-interop doesn't seem to work as effortlessly as I'd like across the board (in Flutter mobile apps and desktop). However, this package should at the very least serve as a good fallback and base for building platform-specific bindings should that be desired in future.
Cyan4973 commented 2022-05-06 17:03:14 -05:00 (Migrated from github.com)

Dart port listed on xxHash homepage

Dart port listed on xxHash homepage
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-Cyan4973/xxHash#702
No description provided.