[Issue 11757] toHexString doesn't support dynamic array

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 17 04:44:33 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11757


bearophile_hugs at eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs at eml.cc


--- Comment #1 from bearophile_hugs at eml.cc 2013-12-17 04:44:30 PST ---
(In reply to comment #0)

>     return hmac_md5(cast(ubyte[])(key), msg);

Don't use cast() unless you know what you are doing.


> 'E0166C00000000000000000000000000'), but if you replace ubyte[] with ubyte[16]
> -or auto-, it'll pass.

One advantage of the current design of toHexString() is that it can't fail,
because the type system makes its usage safe and correct for most situations.
(Unless you use cast() randomly).

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list