From d157162bc758d519d2361518736fe481975e8c46 Mon Sep 17 00:00:00 2001
From: david_page <david_page@localhost>
Date: Fri, 28 Sep 2007 03:44:00 +0000
Subject: [PATCH] Issue 466 (partial) Secret key encoding

---
 opends/src/server/org/opends/server/util/StaticUtils.java |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/util/StaticUtils.java b/opends/src/server/org/opends/server/util/StaticUtils.java
index 6f771db..e944ad7 100644
--- a/opends/src/server/org/opends/server/util/StaticUtils.java
+++ b/opends/src/server/org/opends/server/util/StaticUtils.java
@@ -747,6 +747,35 @@
 
   /**
    * Retrieves a string representation of the contents of the provided byte
+   * array using hexadecimal characters with no space between each byte.
+   *
+   * @param  b  The byte array containing the data.
+   *
+   * @return  A string representation of the contents of the provided byte
+   *          array using hexadecimal characters.
+   */
+  public static String bytesToHexNoSpace(byte[] b)
+  {
+    if ((b == null) || (b.length == 0))
+    {
+      return "";
+    }
+
+    int arrayLength = b.length;
+    StringBuilder buffer = new StringBuilder(arrayLength * 2);
+
+    for (int i=0; i < arrayLength; i++)
+    {
+      buffer.append(byteToHex(b[i]));
+    }
+
+    return buffer.toString();
+  }
+
+
+
+  /**
+   * Retrieves a string representation of the contents of the provided byte
    * array using hexadecimal characters and a space between each byte.
    *
    * @param  b  The byte array containing the data.

--
Gitblit v1.10.0