comparison dcrypt/misc/ByteConverter.d @ 32:2b4bccdc8387

Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
author Thomas Dixon <reikon@reikon.us>
date Tue, 12 May 2009 22:09:33 -0400
parents f429c5e9dd69
children
comparison
equal deleted inserted replaced
31:f429c5e9dd69 32:2b4bccdc8387
163 } 163 }
164 164
165 return cast(string)output; 165 return cast(string)output;
166 } 166 }
167 167
168 /** Play nice with D2's idea of const. */
169 version (D_Version2)
170 {
171 static string hexEncode(string input_)
172 {
173 return hexEncode(cast(ubyte[])input_);
174 }
175 }
176
168 static ubyte[] hexDecode(string input) 177 static ubyte[] hexDecode(string input)
169 { 178 {
170 string inputAsLower = stringToLower(input); 179 string inputAsLower = stringToLower(input);
171 ubyte[] output = new ubyte[input.length>>1]; 180 ubyte[] output = new ubyte[input.length>>1];
172 181