Security implemented + Partial publish
diff --git a/js/CCNTime.js b/js/CCNTime.js
index 26e98df..d4a8098 100644
--- a/js/CCNTime.js
+++ b/js/CCNTime.js
@@ -5,23 +5,21 @@
var CCNTime = function CCNTime(
- msec) {
+ input) {
this.NANOS_MAX = 999877929;
- if(typeof msec =='object'){
- this.setDateBinary(msec);
- this.msec = msec;
- this.msecHex = toHex(msec);
- }
- else if(typeof msec =='string'){
-
- this.msec = toNumbers(msec);
- this.setDateBinary(this.msec);
- this.msecHex = msec;
+ /*if(typeof input =='object'){
+ this.longDate = DataUtils.byteArrayToUnsignedLong(input);
+ this.binaryDate = input;
+ }*/
+ if(typeof input =='number'){
+ this.msec = input;
+ //this.binaryDate = DataUtils.unsignedLongToByteArray(input);
+
}
else{
if(LOG>1) console.log('UNRECOGNIZED TYPE FOR TIME');
@@ -29,6 +27,12 @@
};
+CCNTime.prototype.getJavascriptDate = function(){
+ var d = new Date();
+ d.setTime( this.msec );
+ return d
+};
+
/**
* Create a CCNTime
* @param timestamp source timestamp to initialize from, some precision will be lost
@@ -39,7 +43,7 @@
* Create a CCNTime from its binary encoding
* @param binaryTime12 the binary representation of a CCNTime
*/
-CCNTime.prototype.setDateBinary = function(
+/*CCNTime.prototype.setDateBinary = function(
//byte []
binaryTime12) {
@@ -55,8 +59,7 @@
b = (binaryTime12[i]) & 0xFF;
value |= b;
}
-
- this.date = value;
+
//this.date = new Date(value);
};
@@ -66,7 +69,7 @@
return this.msec; //unsignedLongToByteArray(this.date.getTime());
-}
+}*/
/*
unsignedLongToByteArray= function( value) {
if( 0 == value )