OK, nobody answers. I think I'll simplify my question ;-) .
How are we supposed to handle bit-level data when both arithmetical and bitwise logical transformations are needed? (Of course I mean in the most efficient way).
Thanks in advance.
OK. Thanks Alex. That's enough. At least now I know that there's nothing better ;-) .
I will keep, anyway, implementing crypto. Just being aware that performance will be bad. But at least we will have some crypto available, which IMHO, it's a very important functionality for some real life applications.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
But there is no conversion operator to override. Dart's "as" isn't a cast, it's a type check.
OK, nobody answers. I think I'll simplify my question ;-) .
How are we supposed to handle bit-level data when both arithmetical and bitwise logical transformations are needed? (Of course I mean in the most efficient way).
Thanks in advance.
El 14/10/2013 13:00, "Iván Zaera Avellón" <iza...@gmail.com> escribió:Hi all:I had a hard time yesterday porting hash algorithm RIPEMD160 from Java to Dart. The reason was the arithmetic for fixed size ints and now I understand that I have not clear how this entities are supposed to be handled in Dart.My doubts are: we have typed_data for efficient arrays of Uint8, Uint32 and the like, but all those lists implement List<int>. Thus, when I want to manipulate any of the values inside those lists I have to resort to int arithmetic which is, to say the least, difficult for fixed size (as Dart ints are of arbitrary precission, which implies variable binary size).We also have fixnum package of Int32 and Int64, which I ended up using to port Java's code quickly.But now I have two unrelated packages which don't talk to each other (typed_data and fixnum) and I must convert from int to Int32 and back and code gets messy.What would be the correct way to do it?Should I implement my own classes|functions for this purposes and use List<my class for this purposes>?Should I use Uint8List and fixnum and convert between them as I'm doing now?Is there any other efficient package for fixed size arithmetic and logical operations I'm missing?Thanks in advance,Ivan
So they seem similar (3 operations each). This makes me think that maybe an Uint32 class could be faster than both the previous, as:
** Uint32.fromInt could be implemented as: _i = (i & 0xffffffff);
Which is just 1 op.
Why don't we have Uint32, Uintx and Uint64? Wouldn't they be faster than Int32, Intx, Int64 because we don't have to deal with the sign?