More update missing
diff --git a/js/encoding/BinaryXMLDecoder.js b/js/encoding/BinaryXMLDecoder.js
index 92e81f1..1175f28 100644
--- a/js/encoding/BinaryXMLDecoder.js
+++ b/js/encoding/BinaryXMLDecoder.js
@@ -493,8 +493,8 @@
byteTimestamp = this.readBinaryElement(startTag);
//CCNTime
- timestamp = new CCNTime();
- timestamp.setDateBinary(byteTimestamp);
+ timestamp = new CCNTime(byteTimestamp);
+ //timestamp.setDateBinary(byteTimestamp);
if (null == timestamp) {
throw new ContentDecodingException("Cannot parse timestamp: " + DataUtils.printHexBytes(byteTimestamp));
@@ -584,6 +584,7 @@
tv = this.decodeTypeAndVal(this.istream);
var valval ;
+
if(typeof tv.val() == 'string'){
valval = (parseInt(tv.val()));
}
diff --git a/js/encoding/BinaryXMLEncoder.js b/js/encoding/BinaryXMLEncoder.js
index a4217ff..a633aa8 100644
--- a/js/encoding/BinaryXMLEncoder.js
+++ b/js/encoding/BinaryXMLEncoder.js
@@ -161,7 +161,7 @@
else{
//else if(typeof Content === 'string'){
- console.log('went here');
+ //console.log('went here');
//this.writeBlob(Content);
//}
diff --git a/js/encoding/DataUtils.js b/js/encoding/DataUtils.js
index 635cac7..5386698 100644
--- a/js/encoding/DataUtils.js
+++ b/js/encoding/DataUtils.js
@@ -21,7 +21,7 @@
"wxyz0123456789+/" +
"=";
-DataUtils.encode64=function encode64(input) {
+DataUtils.stringtoBase64=function stringtoBase64(input) {
input = escape(input);
var output = "";
var chr1, chr2, chr3 = "";
@@ -56,7 +56,7 @@
return output;
}
-DataUtils.decode64 = function decode64(input) {
+DataUtils.base64toString = function base64toString(input) {
var output = "";
var chr1, chr2, chr3 = "";
var enc1, enc2, enc3, enc4 = "";
@@ -155,3 +155,37 @@
};
+//http://ejohn.org/blog/numbers-hex-and-colors/
+function toHex(arguments){
+ //console.log(arguments);
+ var ret = "";
+ for ( var i = 0; i < arguments.length; i++ )
+ ret += (arguments[i] < 16 ? "0" : "") + arguments[i].toString(16);
+ return ret.toUpperCase();
+}
+
+//DOES NOT SEEM TO WORK
+function toString(arguments){
+ //console.log(arguments);
+ var ret = "";
+ for ( var i = 0; i < arguments.length; i++ )
+ ret += String.fromCharCode(arguments[i]);
+ return ret;
+}
+
+function toNumbers( str ){
+ if(typeof str =='string'){
+ var ret = [];
+ str.replace(/(..)/g, function(str){
+ ret.push( parseInt( str, 16 ) );
+ });
+ return ret;
+ }
+}
+
+function toNumbersFromString( str ){
+ var bytes = new Array(str.length);
+ for(var i=0;i<str.length;i++)
+ bytes[i] = str.charCodeAt(i);
+ return bytes;
+}
\ No newline at end of file