md5 hashing acting strangly?

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jul 16 10:55:26 PDT 2014


Ary Borenszweig:

> When assigning a fixed size array to a slice, can't you just 
> allocate memory and copy the data there (I mean, let the 
> compiler do that in that case)? That would be safe, right?

Yes, using a .dup:

char[] hashstring = toHexString(hash).dup;

But the compiler should not do this by itself.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list