summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/ByteArray.js
Side-by-side diff
Diffstat (limited to 'frontend/gamma/js/Clipperz/ByteArray.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/ByteArray.js71
1 files changed, 16 insertions, 55 deletions
diff --git a/frontend/gamma/js/Clipperz/ByteArray.js b/frontend/gamma/js/Clipperz/ByteArray.js
index ae586e7..22c7c6e 100644
--- a/frontend/gamma/js/Clipperz/ByteArray.js
+++ b/frontend/gamma/js/Clipperz/ByteArray.js
@@ -2,6 +2,5 @@
-Copyright 2008-2011 Clipperz Srl
+Copyright 2008-2013 Clipperz Srl
-This file is part of Clipperz Community Edition.
-Clipperz Community Edition is an online password manager.
+This file is part of Clipperz, the online password manager.
For further information about its features and functionalities please
@@ -9,10 +8,10 @@ refer to http://www.clipperz.com.
-* Clipperz Community Edition is free software: you can redistribute
- it and/or modify it under the terms of the GNU Affero General Public
- License as published by the Free Software Foundation, either version
- 3 of the License, or (at your option) any later version.
+* Clipperz is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Affero General Public License as published
+ by the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
-* Clipperz Community Edition is distributed in the hope that it will
- be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+* Clipperz is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Affero General Public License for more details.
@@ -20,4 +19,3 @@ refer to http://www.clipperz.com.
* You should have received a copy of the GNU Affero General Public
- License along with Clipperz Community Edition. If not, see
- <http://www.gnu.org/licenses/>.
+ License along with Clipperz. If not, see http://www.gnu.org/licenses/.
@@ -91,7 +89,4 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
'checkByteValue': function(aValue) {
-//Clipperz.log("aValue", aValue.toString(16));
-//Clipperz.log("(aValue & 0xff)", (aValue & 0xff).toString(16));
-
if ((aValue & 0xff) != aValue) {
- MochiKit.Logging.logError("Clipperz.ByteArray.appendByte: the provided value (0x" + aValue.toString(16) + ") is not a byte value.");
+ Clipperz.logError("Clipperz.ByteArray.appendByte: the provided value (0x" + aValue.toString(16) + ") is not a byte value.");
throw Clipperz.ByteArray.exception.InvalidValue;
@@ -146,4 +141,2 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
-
-// result = new Clipperz.ByteArray();
result = this.newInstance();
@@ -158,12 +151,2 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
//-------------------------------------------------------------------------
-/*
- 'shiftLeft': function(aNumberOfBitsToShift) {
- var result;
-
- result = this.clone(); // ???????????
-
- return result;
- },
-*/
- //-------------------------------------------------------------------------
@@ -294,3 +277,2 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
result = selectedByte & selectedByteMask ? 1 : 0;
-//console.log("aBitPosition: " + aBitPosition + ", length: " + this.length() + ", bytePosition: " + bytePosition + ", bitPositionInSelectedByte: " + bitPositionInSelectedByte + ", selectedByteMask: " + selectedByteMask);
@@ -323,5 +305,2 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
-//var startTime = new Date();
-
-//# result = "";
result = [];
@@ -367,3 +346,2 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
-// result += currentCharacter;
result.push(currentCharacter);
@@ -372,5 +350,2 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
-//MochiKit.Logging.logDebug("[" + (new Date() - startTime) + "] ByteArray.asString");
-
-// return result;
return result.join("");
@@ -388,11 +363,2 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
'base64mapIndex': "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(''),
-// 'base64mapInvertedIndex': {
-// 'A': 0, 'B': 1, 'C': 2, 'D': 3, 'E': 4, 'F': 5, 'G': 6, 'H': 7, 'I': 8, 'J': 9,
-// 'K': 10, 'L': 11, 'M': 12, 'N': 13, 'O': 14, 'P': 15, 'Q': 16, 'R': 17, 'S': 18, 'T': 19,
-// 'U': 20, 'V': 21, 'W': 22, 'X': 23, 'Y': 24, 'Z': 25, 'a': 26, 'b': 27, 'c': 28, 'd': 29,
-// 'e': 30, 'f': 31, 'g': 32, 'h': 33, 'i': 34, 'j': 35, 'k': 36, 'l': 37, 'm': 38, 'n': 39,
-// 'o': 40, 'p': 41, 'q': 42, 'r': 43, 's': 44, 't': 45, 'u': 46, 'v': 47, 'w': 48, 'x': 49,
-// 'y': 50, 'z': 51, '0': 52, '1': 53, '2': 54, '3': 55, '4': 56, '5': 57, '6': 58, '7': 59,
-// '8': 60, '9': 61, '+': 62, '/': 63,
-// "=": -1},
@@ -407,3 +373,3 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
if ((length % 4) != 0) {
- MochiKit.Logging.logError("the value passed to the 'ByteArray.setBase64Value' is not correct");
+ Clipperz.logError("the value passed to the 'ByteArray.setBase64Value' is not correct");
throw Clipperz.ByteArray.exception.InvalidValue;
@@ -421,7 +387,2 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
-// value1 = this.base64mapInvertedIndex[aValue.charAt(i)];
-// value2 = this.base64mapInvertedIndex[aValue.charAt(i+1)];
-// value3 = this.base64mapInvertedIndex[aValue.charAt(i+2)];
-// value4 = this.base64mapInvertedIndex[aValue.charAt(i+3)];
-
byte1 = (value1 << 2) | ((value2 & 0x30) >> 4);
@@ -522,3 +483,3 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
if ((length % 8) != 0) {
- MochiKit.Logging.logError("the value passed to the 'ByteArray.setBase32Value' is not correct");
+ Clipperz.logError("the value passed to the 'ByteArray.setBase32Value' is not correct");
throw Clipperz.ByteArray.exception.InvalidValue;
@@ -730,3 +691,3 @@ Clipperz.ByteArray_hex = function (args) {
} else {
-MochiKit.Logging.logError("Clipperz.ByteArray should be inizialized with an hex string.");
+Clipperz.logError("Clipperz.ByteArray should be inizialized with an hex string.");
throw Clipperz.ByteArray.exception.InvalidValue;
@@ -916,3 +877,3 @@ Clipperz.ByteArray_array = function (args) {
} else {
-MochiKit.Logging.logError("Clipperz.ByteArray should be inizialized with an hex string.");
+ Clipperz.logError("Clipperz.ByteArray should be inizialized with an hex string.");
throw Clipperz.ByteArray.exception.InvalidValue;
@@ -1117,3 +1078,3 @@ Clipperz.ByteArray_string = function (args) {
} else {
-MochiKit.Logging.logError("Clipperz.ByteArray should be inizialized with an hex string.");
+Clipperz.logError("Clipperz.ByteArray should be inizialized with an hex string.");
throw Clipperz.ByteArray.exception.InvalidValue;