comparison dcrypt/misc/ByteConverter.d @ 29:b9ba770b8f16

Second go at D2 compatibility. Changed the hexEncode method of the ByteConverter class and the hexDigest methods of various classes to return char[] instead of string.
author Thomas Dixon <reikon@reikon.us>
date Mon, 11 May 2009 01:39:19 -0400
parents ad687db713a4
children 21847420b1ac
comparison
equal deleted inserted replaced
28:ad687db713a4 29:b9ba770b8f16
126 } 126 }
127 return output; 127 return output;
128 } 128 }
129 } 129 }
130 130
131 static string hexEncode(void[] input_) { 131 static char[] hexEncode(void[] input_) {
132 ubyte[] input = cast(ubyte[])input_; 132 ubyte[] input = cast(ubyte[])input_;
133 string output = new char[input.length<<1]; 133 char[] output = new char[input.length<<1];
134 134
135 int i = 0; 135 int i = 0;
136 foreach (ubyte j; input) { 136 foreach (ubyte j; input) {
137 output[i++] = hexits[j>>4]; 137 output[i++] = hexits[j>>4];
138 output[i++] = hexits[j&0xf]; 138 output[i++] = hexits[j&0xf];