# HG changeset patch # User Thomas Dixon # Date 1242020359 14400 # Node ID b9ba770b8f161d8755d213d4c4b59688b48fb542 # Parent ad687db713a418f3fd63b5515030dd74e2827761 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. diff -r ad687db713a4 -r b9ba770b8f16 dcrypt/crypto/Hash.d --- a/dcrypt/crypto/Hash.d Sun May 10 22:38:48 2009 -0400 +++ b/dcrypt/crypto/Hash.d Mon May 11 01:39:19 2009 -0400 @@ -131,7 +131,7 @@ * * Returns: Representation of the final hash value in hex. */ - string hexDigest() + char[] hexDigest() { return ByteConverter.hexEncode(digest()); } diff -r ad687db713a4 -r b9ba770b8f16 dcrypt/crypto/MAC.d --- a/dcrypt/crypto/MAC.d Sun May 10 22:38:48 2009 -0400 +++ b/dcrypt/crypto/MAC.d Mon May 11 01:39:19 2009 -0400 @@ -48,7 +48,7 @@ ubyte[] digest(); /** Returns: The computed MAC in hexadecimal. */ - string hexDigest() + char[] hexDigest() { return ByteConverter.hexEncode(digest()); } diff -r ad687db713a4 -r b9ba770b8f16 dcrypt/crypto/macs/HMAC.d --- a/dcrypt/crypto/macs/HMAC.d Sun May 10 22:38:48 2009 -0400 +++ b/dcrypt/crypto/macs/HMAC.d Mon May 11 01:39:19 2009 -0400 @@ -116,7 +116,7 @@ return r; } - string hexDigest() + char[] hexDigest() { return ByteConverter.hexEncode(digest()); } diff -r ad687db713a4 -r b9ba770b8f16 dcrypt/misc/ByteConverter.d --- a/dcrypt/misc/ByteConverter.d Sun May 10 22:38:48 2009 -0400 +++ b/dcrypt/misc/ByteConverter.d Mon May 11 01:39:19 2009 -0400 @@ -128,9 +128,9 @@ } } - static string hexEncode(void[] input_) { + static char[] hexEncode(void[] input_) { ubyte[] input = cast(ubyte[])input_; - string output = new char[input.length<<1]; + char[] output = new char[input.length<<1]; int i = 0; foreach (ubyte j; input) {