Mercurial > projects > dcrypt
changeset 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 |
files | dcrypt/crypto/Hash.d dcrypt/crypto/MAC.d dcrypt/crypto/macs/HMAC.d dcrypt/misc/ByteConverter.d |
diffstat | 4 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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()); }
--- 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()); }
--- 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()); }
--- 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) {