author | Clipperz <info@clipperz.com> | 2013-01-31 13:42:04 (UTC) |
---|---|---|
committer | Clipperz <info@clipperz.com> | 2013-01-31 13:42:04 (UTC) |
commit | 07d0357beef5d9328a2dd8d07ad7b39c87ac55e4 (patch) (unidiff) | |
tree | f7a4aed8848302db153c2a211f8e58b944eb4c5b /frontend/beta/js/Clipperz/ByteArray.js | |
parent | 767a3dcf48b6ac911c088af5dd7738a728eb6b99 (diff) | |
download | clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.zip clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.tar.gz clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.tar.bz2 |
Updated Copyright claims
- updated reference dates;
- removed reference to Community Edition;
- normalized logging using Clipperz.log[Warn|Error|Debug]
Diffstat (limited to 'frontend/beta/js/Clipperz/ByteArray.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/ByteArray.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/frontend/beta/js/Clipperz/ByteArray.js b/frontend/beta/js/Clipperz/ByteArray.js index a69aa43..540563f 100644 --- a/frontend/beta/js/Clipperz/ByteArray.js +++ b/frontend/beta/js/Clipperz/ByteArray.js | |||
@@ -1,118 +1,116 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | 25 | ||
28 | //============================================================================= | 26 | //============================================================================= |
29 | 27 | ||
30 | Clipperz.ByteArray_abstract = function(args) { | 28 | Clipperz.ByteArray_abstract = function(args) { |
31 | return this; | 29 | return this; |
32 | } | 30 | } |
33 | 31 | ||
34 | Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, { | 32 | Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, { |
35 | 33 | ||
36 | //------------------------------------------------------------------------- | 34 | //------------------------------------------------------------------------- |
37 | 35 | ||
38 | 'toString': function() { | 36 | 'toString': function() { |
39 | return "Clipperz.ByteArray_abstract"; | 37 | return "Clipperz.ByteArray_abstract"; |
40 | }, | 38 | }, |
41 | 39 | ||
42 | //------------------------------------------------------------------------- | 40 | //------------------------------------------------------------------------- |
43 | 41 | ||
44 | 'equals': function(aValue) { | 42 | 'equals': function(aValue) { |
45 | return (this.compare(aValue) == 0); | 43 | return (this.compare(aValue) == 0); |
46 | }, | 44 | }, |
47 | 45 | ||
48 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
49 | 47 | ||
50 | 'compare': function(aValue) { | 48 | 'compare': function(aValue) { |
51 | var result; | 49 | var result; |
52 | var i; | 50 | var i; |
53 | 51 | ||
54 | result = MochiKit.Base.compare(this.length(), aValue.length()); | 52 | result = MochiKit.Base.compare(this.length(), aValue.length()); |
55 | i = this.length(); | 53 | i = this.length(); |
56 | 54 | ||
57 | while ((result == 0) && (i>0)) { | 55 | while ((result == 0) && (i>0)) { |
58 | i--; | 56 | i--; |
59 | result = MochiKit.Base.compare(this.byteAtIndex(i), aValue.byteAtIndex(i)); | 57 | result = MochiKit.Base.compare(this.byteAtIndex(i), aValue.byteAtIndex(i)); |
60 | } | 58 | } |
61 | 59 | ||
62 | return result; | 60 | return result; |
63 | }, | 61 | }, |
64 | 62 | ||
65 | //------------------------------------------------------------------------- | 63 | //------------------------------------------------------------------------- |
66 | 64 | ||
67 | 'clone': function() { | 65 | 'clone': function() { |
68 | throw Clipperz.Base.exception.AbstractMethod; | 66 | throw Clipperz.Base.exception.AbstractMethod; |
69 | }, | 67 | }, |
70 | 68 | ||
71 | //------------------------------------------------------------------------- | 69 | //------------------------------------------------------------------------- |
72 | 70 | ||
73 | 'newInstance': function() { | 71 | 'newInstance': function() { |
74 | throw Clipperz.Base.exception.AbstractMethod; | 72 | throw Clipperz.Base.exception.AbstractMethod; |
75 | }, | 73 | }, |
76 | 74 | ||
77 | //------------------------------------------------------------------------- | 75 | //------------------------------------------------------------------------- |
78 | 76 | ||
79 | 'reset': function() { | 77 | 'reset': function() { |
80 | throw Clipperz.Base.exception.AbstractMethod; | 78 | throw Clipperz.Base.exception.AbstractMethod; |
81 | }, | 79 | }, |
82 | 80 | ||
83 | //------------------------------------------------------------------------- | 81 | //------------------------------------------------------------------------- |
84 | 82 | ||
85 | 'length': function() { | 83 | 'length': function() { |
86 | throw Clipperz.Base.exception.AbstractMethod; | 84 | throw Clipperz.Base.exception.AbstractMethod; |
87 | }, | 85 | }, |
88 | 86 | ||
89 | //------------------------------------------------------------------------- | 87 | //------------------------------------------------------------------------- |
90 | 88 | ||
91 | 'checkValue': function(aValue) { | 89 | 'checkValue': function(aValue) { |
92 | if ((aValue & 0xff) != aValue) { | 90 | if ((aValue & 0xff) != aValue) { |
93 | MochiKit.Logging.logError("Clipperz.ByteArray.appendByte: the provided value (0x" + aValue.toString(16) + ") is not a byte value."); | 91 | MochiKit.Logging.logError("Clipperz.ByteArray.appendByte: the provided value (0x" + aValue.toString(16) + ") is not a byte value."); |
94 | throw Clipperz.ByteArray.exception.InvalidValue; | 92 | throw Clipperz.ByteArray.exception.InvalidValue; |
95 | } | 93 | } |
96 | }, | 94 | }, |
97 | 95 | ||
98 | //------------------------------------------------------------------------- | 96 | //------------------------------------------------------------------------- |
99 | 97 | ||
100 | 'xorMergeWithBlock': function(aBlock, anAllignment, paddingMode) { | 98 | 'xorMergeWithBlock': function(aBlock, anAllignment, paddingMode) { |
101 | var result; | 99 | var result; |
102 | var a, b; | 100 | var a, b; |
103 | var aLength; | 101 | var aLength; |
104 | var bLength; | 102 | var bLength; |
105 | var i, c; | 103 | var i, c; |
106 | 104 | ||
107 | if (this.length() > aBlock.length()) { | 105 | if (this.length() > aBlock.length()) { |
108 | a = this; | 106 | a = this; |
109 | b = aBlock; | 107 | b = aBlock; |
110 | } else { | 108 | } else { |
111 | a = aBlock; | 109 | a = aBlock; |
112 | b = this; | 110 | b = this; |
113 | } | 111 | } |
114 | 112 | ||
115 | aLength = a.length(); | 113 | aLength = a.length(); |
116 | bLength = b.length(); | 114 | bLength = b.length(); |
117 | 115 | ||
118 | if (aLength != bLength) { | 116 | if (aLength != bLength) { |