Added hexToRawString.
diff --git a/js/encoding/DataUtils.js b/js/encoding/DataUtils.js
index 3b5ea15..e6ae2fc 100644
--- a/js/encoding/DataUtils.js
+++ b/js/encoding/DataUtils.js
@@ -71,6 +71,7 @@
// remove all characters that are not A-Z, a-z, 0-9, +, /, or =
var base64test = /[^A-Za-z0-9\+\/\=]/g;
+ /* Test for invalid characters. */
if (base64test.exec(input)) {
alert("There were invalid base64 characters in the input text.\n" +
"Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\n" +
@@ -273,6 +274,19 @@
}
/**
+ * Hex String to raw string.
+ */
+DataUtils.hexToRawString = function(str) {
+ if(typeof str =='string') {
+ var ret = "";
+ str.replace(/(..)/g, function(s) {
+ ret += String.fromCharCode(parseInt(s, 16));
+ });
+ return ret;
+ }
+}
+
+/**
* Raw String to Byte Array
*/
DataUtils.toNumbersFromString = function( str ){