std.digest can't CTFE?
Johannes Pfau
nospam at example.com
Fri Jun 1 10:04:52 UTC 2018
Am Fri, 01 Jun 2018 08:50:19 +0000 schrieb Kagamin:
> On Friday, 1 June 2018 at 08:37:33 UTC, Johannes Pfau wrote:
>> I don't know if anything changed in this regard since std.digest was
>> written some time ago. But if you get the std.bitmanip nativeTo*Endian
>> and *EndianToNative functions to work in CTFE, std.digest should work
>> as well.
>
> Standard cryptographic algorithms are by design not dependent on
> endianness, rather they set on a specific endianness.
However you want to call it, the algorithms interpret data as numbers
which means that the binary representation differs based on endianess.
If you want portable results, you can't ignore that fact in the
implementation. So even though the algorithms are not dependent on the
endianess, the representation of the result is. Therefore standards do
usually propose an internal byte order.
--
Johannes
More information about the Digitalmars-d
mailing list