cansin-blogdata 3.0.5 → 3.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/css/fcircle.css DELETED
@@ -1,337 +0,0 @@
1
- /*
2
- Last Modified time : 20220211 98:00 by https://immmmm.com
3
- 已适配 FriendCircle 公共库和主库
4
- */
5
- :root{
6
- --lmm-hover: rgb(0,100,255);
7
- --lmm-fontcolor: #363636;
8
- --lmm-background: #f7f9fe;
9
- --lmm-floorcolor: #a9a9b3;
10
- --lmm-dark-fontcolor: #a9a9b3;
11
- --lmm-dack-background: #252627;
12
- --lmm-dark-floorcolor: #454545;
13
- }
14
- [data-theme=light] {
15
- --lmm-fontcolor: #363636;
16
- --lmm-background: #fff;
17
- --lmm-floorcolor: #a9a9b3;
18
- --gavin-bg-3: rgb(248,248,248);
19
- }
20
- [data-theme=dark] {
21
- --lmm-fontcolor: #a9a9b3;
22
- --lmm-background: #202224;
23
- --lmm-floorcolor: #454545;
24
- --gavin-bg-3: rgb(7,7,7);
25
- }
26
- /* 基本信息 */
27
- #cf-state {font-size:16px;border-radius:13px;border: 1px solid var(--gavin-card-border);box-shadow:var(--gavin-shadow-1);margin:0 0 20px;overflow:hidden;display:flex;flex-direction:row;flex-wrap:wrap;padding:8px 0;}
28
- .cf-state-data {width:100%;display:flex;justify-content:space-evenly;}
29
- .cf-data-friends,.cf-data-active,.cf-data-article{height:60px;background:transparent;display:flex;flex-direction:column;cursor:pointer;font-weight:bold;}
30
- .cf-data-friends:hover,.cf-data-active:hover,.cf-data-article:hover{color:var(--gavin-highlight);}
31
- .cf-label {font-size:16px;padding:0;align-self:center;text-align:center;width:100%;height:30px;}
32
- .cf-message{align-self:center;text-align:center;padding:0;width:100%;font-size:20px;}
33
- /* 排序按钮 */
34
- #cf-change{font-size:14px;display:block;padding:12px 0 4px;width:100%;text-align:center;}
35
- /* 更多按钮 */
36
- #cf-more {width:60%;/*max-width:810px*/;height:30px;margin:20px auto 0;border-radius:50px;border:1px solid var(--gavin-card-border);font-weight:bolder;text-align:center;display:flex;flex-direction:column;justify-content:space-around;cursor:pointer;transition:0.3s;}
37
- #cf-more:hover{width:100%;background: var(--gavin-highlight);color: var(--f-0);}
38
- #cf-more i.fas::before {content:"∞";}
39
- /* 主容器 */
40
- #cf-container {width:100%;/*max-width:900px;*/height:auto;margin:auto;display:flex;flex-wrap:wrap;gap:20px;}
41
- #cf-container a {text-decoration:none;}
42
- .cf-article {/*margin:0 0 20px;*/border-radius:13px;border: 1px solid var(--gavin-card-border);font-weight:bolder;overflow:hidden;transition: all ease-out .3s;position: relative;padding:8px 15px;width:calc(100% / 3 - 40px / 3);float:left;height: 110px;}
43
- .cf-article:hover{transition:all .3s;/*-webkit-transform:scale(1.03);transform:scale(1.03);*/border-color: var(--gavin-highlight);}
44
- .cf-article-avatar{display:flex;align-items:center;position:absolute;bottom:8px;left:15px;}
45
- .cf-img-avatar {align-self:center;text-align:center;display:inline-block !important;width:22px;height:22px;border-radius:50%!important;margin:0 0 -4px !important;background: #fff;}
46
- .cf-article-author{line-height: 35px;font-size:14px;font-weight: 400;margin-left:5px;align-self:center;text-align:center;height:40px;white-space:nowrap;overflow:hidden;}
47
- /* .cf-article-floor{position: absolute;top: 0.6rem;right:0.6rem;font-style: italic;font-size: 3rem;line-height: 1.5rem;z-index:1;font-weight: 400;display:none;} */
48
- .cf-article-title{color: var(--lmm-fontcolor)!important;font-weight: 500;position: relative;z-index:2;width:fit-content;max-width:calc(100% - 30px);display: -webkit-box;/*letter-spacing:1.5px;*/font-size:18px;align-self:start;text-align:left;line-height:1.3;padding:0;margin:5px 0;transition:0.3s;overflow:hidden;/*white-space: nowrap;text-overflow: ellipsis;*/-webkit-box-orient:vertical;-webkit-line-clamp:2;}
49
- .cf-article-time {font-size:14px;text-align:right;float:right;font-weight:400;position:absolute;right:17px;bottom:17px;line-height:1;}
50
- .cf-time-updated,.cf-time-created {display:inline-block;text-align:left;white-space:nowrap;}
51
- .cf-time-updated i.fas,.cf-time-created i.far{padding-right:8px;}
52
- .cf-article-time i:before {margin-right:5px;}
53
- /* 底部 */
54
- #cf-footer{margin:6rem 1% 2rem 0;text-align:right;font-size:13px;color:var(--gavin-note-font-color)}
55
- .cf-data-lastupdated{font-size:13px;text-align:right;display: block;}
56
- /* 个人文章列表层 */
57
- #cf-overlay,#cf-overshow{position:fixed;width:100%;height:100%;}
58
- #cf-overlay{top: 0;left:0;background-color: rgba(255, 255, 255, 0.12);-webkit-backdrop-filter: blur(0px);backdrop-filter: blur(0px);overflow-y:auto;pointer-events: none;opacity: 0;transition: all 0.5s ease;z-index: 998;}
59
- #cf-overshow{bottom: 0;left:0;opacity: 0;pointer-events:none;transition: all 0.5s ease;z-index: 999;}
60
- #cf-overlay.cf-show-now{left:0;-webkit-backdrop-filter: blur(7px);backdrop-filter: blur(7px);opacity: 1;transition: all .5s ease;}
61
- #cf-overshow.cf-show-now{bottom:0;opacity: 1;pointer-events: all;transition: all .5s ease;}
62
- .cf-overshow{text-align: center;border-radius: 1rem;position: absolute;width: 290px;padding:0 10px 20px;min-height:170px;left: 50%;top:50%;transform: translate(-50%,-50%);box-shadow: 0 12px 40px rgba(0, 0, 0, 0.093);background: var(--f-0);border: 1px solid var(--gavin-border-color);}
63
- .cf-overshow-head:hover img.cf-img-avatar{transform:rotate(360deg);transition:0.8s;}
64
- .cf-overshow .cf-overshow-head a{color:var(--dis-f-0)!important;display:block;text-align:center;font-weight:bold;margin-top:-5px;padding:5px 8px 5px;}
65
- .cf-overshow img.cf-img-avatar{background:#fff;width: 80px;height: 80px;border-radius: 50%!important;margin: 20px auto 0 !important;box-shadow: 0 12px 40px rgb(0 0 0 / 9%);transform:rotate(-360deg);transition:0.3s!important;}
66
- .cf-overshow p{margin:0.3rem 5px;width:100%;position: relative;}
67
- .cf-overshow p a.cf-article-title{display:block;text-align:left;position: relative;z-index: 2;font-size:15px;font-weight:600;line-height:25px;margin-bottom:15px;letter-spacing: normal;max-height:50px;overflow: hidden;white-space: normal;text-overflow:ellipsis;display:-webkit-box;display:box;-webkit-line-clamp: 1; -webkit-box-orient: vertical;max-width: unset;}
68
- .cf-overshow p span{position: absolute;bottom:-1rem;right:0;z-index: 1;font-style: italic;font-size:12px;}
69
- #cf-container .cf-overshow p a:hover{letter-spacing:1px;transition:0.3s;}
70
- .cf-overshow .cf-overshow-content{padding:0 10px;margin:10px 0 0;max-height:290px;overflow-y:auto;-webkit-mask-image:linear-gradient(0deg,transparent,#fff 20px,#fff calc(100% - 10px),transparent);mask-image:linear-gradient(0deg,transparent,#fff 20px,#fff calc(100% - 10px),transparent);/*border-bottom-left-radius:20px;border-bottom-right-radius:20px;background: var(--f-0);*/}
71
- .cf-overshow .cf-overshow-content::-webkit-scrollbar{display: none}
72
- #cf-overshow .cf-overshow-close{position:sticky;display: block;width:100%;height:100%;}
73
- /* 颜色 */
74
- .cf-article .cf-article-title:hover{/*letter-spacing:2px;*/color:var(--gavin-highlight)!important;}
75
- /* #cf-more i.fas:hover{color:var(--lmm-hover);} */
76
- #cf-state,#cf-more {background:var(--card-bg);color:var(--lmm-fontcolor);}
77
- #cf-change,.cf-time-updated,.cf-time-created,.cf-article-floor{color:var(--gavin-note-font-color);}
78
- .cf-article-author,.cf-article a.cf-article-title,/*.cf-article:hover .cf-article-floor,*/.cf-article:hover .cf-time-created,.cf-article:hover .cf-time-updated{color:var(--lmm-fontcolor);}
79
- .cf-article {background:var(--card-bg);box-shadow: var(--gavin-shadow-1);}
80
- #cf-change span:hover{color:var(--gavin-highlight);cursor:pointer;}
81
- #cf-change .cf-change-now{color:var(--gavin-highlight);font-weight:800;}
82
- .cf-overshow p a:hover{color:var(--gavin-blue2)!important;text-decoration:none!important;}
83
- .cf-overshow p span{color:var(--gavin-note-font-color)}
84
- /* 暗色主题 */
85
- .dark-theme #cf-overlay,.theme-dark #cf-overlay{background-color: rgba(59, 61, 66, 0.42);}
86
- .dark-theme .cf-overshow,.theme-dark .cf-overshow{background: #292a2d;}
87
- .dark-theme .cf-overshow p a,.theme-dark .cf-overshow p a{color: var(--lmm-fontcolor);}
88
- .dark-theme .cf-overshow .cf-overshow-content,.theme-dark .cf-overshow .cf-overshow-content{background: #eaeaea;}
89
- .dark-theme #cf-state,.dark-theme #cf-more,.theme-dark #cf-state,.theme-dark #cf-more {background:var(--lmm-dack-background);color:var(--lmm-dark-fontcolor);}
90
- .dark-theme #cf-change,.dark-theme .cf-time-updated,.dark-theme .cf-time-created,.dark-theme .cf-article-floor,.theme-dark #cf-change,.theme-dark .cf-time-updated,.theme-dark .cf-time-created,.theme-dark .cf-article-floor{color:var(--lmm-dark-floorcolor);}
91
- .dark-theme .cf-article-author,.dark-theme .cf-article a.cf-article-title,.theme-dark .cf-article-author,.theme-dark .cf-article a.cf-article-title {color:var(--lmm-dark-fontcolor);}
92
- .dark-theme .cf-article,.theme-dark .cf-article {background:var(--lmm-dack-background);}
93
- .dark-theme .cf-article:hover .cf-article-floor,.dark-theme .cf-article:hover .cf-time-created,.dark-theme .cf-article:hover .cf-time-updated,.dark-theme .cf-overshow p span,.theme-dark .cf-article:hover .cf-article-floor,.theme-dark .cf-article:hover .cf-time-created,.theme-dark .cf-article:hover .cf-time-updated,.theme-dark .cf-overshow p span{color: var(--lmm-dark-fontcolor);}
94
- /* 补充 */
95
- #cf-container .img-alt.is-center {display: none;}
96
- #article-container a:hover{text-decoration: none;}
97
- span.cf-article-author:hover{color: var(--gavin-highlight)!important;}
98
- div#cf-footer a {color: var(--dis-f-0);}
99
- .cf-overshow-head {margin: 0 10px;border-bottom: 1px dashed var(--gavin-note-font-color);}
100
- div#cf-random-post {
101
- background: var(--card-bg);
102
- border: 1px solid var(--gavin-border-color);
103
- border-radius: 0.8rem;
104
- height: 4rem;
105
- margin: 0 10px;
106
- display: flex;
107
- align-items: center;
108
- padding: 15px;
109
- color: var(--lmm-fontcolor);
110
- font-size: 1.1rem;
111
- height: fit-content;
112
- }
113
- .cf-overshow > .cf-overshow-content > p {
114
- margin: 0 0 2rem!important;
115
- }
116
- .cf-overshow .cf-overshow-head a:hover {
117
- text-decoration: none!important;
118
- color: var(--gavin-blue2)!important;
119
- }
120
- #cf-footer a:hover {
121
- text-decoration: none;
122
- color: var(--gavin-blue2);
123
- }
124
- .cf-star {
125
- color: var(--lmm-fontcolor)!important;
126
- width: 35px;
127
- height: 35px;
128
- font-size: 18px;
129
- position: absolute;
130
- right: 8px;
131
- top: 8px;
132
- display: flex;
133
- align-items: center;
134
- justify-content: center;
135
- cursor: pointer;
136
- }
137
- .cf-star:hover {
138
- color: var(--gavin-highlight)!important;
139
- }
140
- .cf-star.saved i {
141
- font-weight: 900;
142
- color: orange;
143
- }
144
- /* 密码输入框 */
145
- #fcircleInputBox {
146
- z-index: 999;
147
- }
148
- #fcircleInputBox .inputBox {
149
- width: 300px;
150
- height: 200px;
151
- background: var(--gavin-bg-3);
152
- border: 1px solid var(--gavin-border-color);
153
- border-radius: 18px;
154
- overflow: hidden;
155
- position: absolute;
156
- opacity: 0;
157
- pointer-events: none;
158
- transition: .5s ease;
159
- }
160
- #fcircleInputBox.show .inputBox:not(.hide) {
161
- opacity: 1;
162
- pointer-events: all;
163
- user-select: none;
164
- transition: .5s ease;
165
- }
166
- .content-body {
167
- width: 100%;
168
- height: 145px;
169
- padding: 20px;
170
- position: relative;
171
- }
172
- .content-body span.title {
173
- display: block;
174
- width: 100%;
175
- font-size: 1.2rem;
176
- font-weight: bold;
177
- line-height: 1.3;
178
- text-align: center;
179
- margin: 0 0 8px;
180
- }
181
- .content-body span.tips {
182
- display: block;
183
- width: 100%;
184
- font-size: 0.85rem;
185
- line-height: 1.3;
186
- text-align: center;
187
- color: var(--gavin-note-font-color);
188
- }
189
- .content-body input.input-password {
190
- display: block;
191
- line-height: 1.3;
192
- width: 260px;
193
- border-radius: 6px;
194
- height: 35px;
195
- position: absolute;
196
- bottom: 10px;
197
- left: 20px;
198
- padding: 4px 8px;
199
- color: var(--font-color);
200
- background: var(--f-0);
201
- border: 1px solid var(--gavin-border-color);
202
- }
203
- .content-body input.input-password:focus {
204
- outline: none;
205
- }
206
- .content-body input.input-password::placeholder {
207
- color: var(--gavin-note-font-color);
208
- }
209
- .content-bottom {
210
- width: 100%;
211
- height: 55px;
212
- border-top: 1px solid var(--gavin-border-color);
213
- display: flex;
214
- }
215
- .content-bottom .btn {
216
- width: 100%;
217
- display: flex;
218
- align-items: center;
219
- justify-content: center;
220
- letter-spacing: 1px;
221
- font-size: 1.1rem;
222
- color: var(--gavin-blue2);
223
- cursor: pointer;
224
- /* background: none;
225
- border: none; */
226
- }
227
- .content-bottom .btn:first-child {
228
- border-right: 1px solid var(--gavin-border-color);
229
- }
230
- .content-bottom .btn:hover {
231
- background-color: rgba(var(--op-dis), .1);
232
- }
233
- #fcircleInputBox .noteBox {
234
- width: 150px;
235
- height: 150px;
236
- background: var(--gavin-bg-3);
237
- border: 1px solid var(--gavin-border-color);
238
- border-radius: 15px;
239
- overflow: hidden;
240
- position: absolute;
241
- display: flex;
242
- justify-content: center;
243
- align-items: center;
244
- opacity: 1;
245
- pointer-events: none;
246
- transition: .5s ease;
247
- }
248
- #fcircleInputBox .noteBox.hide {
249
- opacity: 0;
250
- transition: .5s ease;
251
- }
252
- #fcircleInputBox .noteBox .icon {
253
- width: 80px;
254
- height: 80px;
255
- display: flex;
256
- align-items: center;
257
- justify-content: center;
258
- position: absolute;
259
- top: 20px;
260
- color: var(--font-color);
261
- font-size: 48px;
262
- }
263
- #fcircleInputBox .noteBox .icon .spinner {
264
- --spinner-w: 5px;
265
- width: 48px;
266
- }
267
- #fcircleInputBox .noteBox .tips {
268
- position: absolute;
269
- bottom: 27px;
270
- line-height: 1.3;
271
- font-size: 1rem;
272
- color: var(--font-color);
273
- text-align: center;
274
- }
275
- #cf-saved-post {
276
- display: flex;
277
- flex-wrap: wrap;
278
- gap: 20px;
279
- max-height: 260px;
280
- overflow: hidden;
281
- transition: .3s ease-in-out;
282
- padding-bottom: 10px;
283
- }
284
- #我的收藏 {
285
- display: flex;
286
- align-items: center;
287
- }
288
- #我的收藏 .refresh,
289
- #我的收藏 .fold {
290
- display: flex;
291
- align-items: center;
292
- justify-content: center;
293
- border-radius: 6px;
294
- width: 36px;
295
- height: 36px;
296
- position: absolute;
297
- cursor: pointer;
298
- color: var(--font-color);
299
- border: 1px solid var(--gavin-border-color);
300
- box-shadow: var(--gavin-shadow-1);
301
- background-color: var(--card-bg);
302
- transition: .3s;
303
- }
304
- #我的收藏 .refresh {
305
- right: 48px;
306
- }
307
- #我的收藏 .fold {
308
- right: 0;
309
- }
310
- #我的收藏 .refresh:hover,
311
- #我的收藏 .fold:hover {
312
- background-color: var(--gavin-widget-bg2);
313
- border-color: rgba(var(--op-dis), .1);
314
- transition: .3s;
315
- }
316
- #我的收藏 .refresh i {
317
- font-size: 20px;
318
- }
319
- #我的收藏 .fold i {
320
- font-size: 12px;
321
- }
322
- /* 移动端适配 */
323
- @media screen and (max-width:1200px) {
324
- .cf-article{width: calc(100% / 2 - 20px / 2)!important;}
325
- }
326
- @media screen and (max-width:850px) {
327
- .cf-article{width: 100%!important;}
328
- }
329
- @media screen and (max-width:500px) {
330
- /* #cf-state {font-size:14px;margin: 0 0 20px;} */
331
- /* .cf-article{margin: 0 0 20px;width: 100%!important;} */
332
- #cf-more{width: 100%!important;}
333
- /* .cf-article-time i{display:none;} */
334
- }
335
- @media screen and (max-width:300px) {
336
- #cf-state,.cf-article-time{display:none;}
337
- }
package/js/encryption.js DELETED
@@ -1,162 +0,0 @@
1
- var _type = document.querySelector(".encryption .select-item.type"),
2
- _code = document.querySelector(".encryption .select-item.code"),
3
- _case = document.querySelector(".encryption .select-item.case"),
4
- _mode = document.querySelector(".encryption .select-item.mode"),
5
- _pad = document.querySelector(".encryption .select-item.pad"),
6
- _key = document.querySelector(".encryption .select-item.key"),
7
- _iv = document.querySelector(".encryption .select-item.iv"),
8
- textIn = document.querySelector('.encryption .inner'),
9
- textOut = document.querySelector('.encryption .outer');
10
- textOut.addEventListener("input", ()=>{
11
- if (textOut.value == '') {
12
- textOut.disabled = true;
13
- textOut.classList.add('lock');
14
- } else {
15
- textOut.disabled = false;
16
- textOut.classList.remove('lock');
17
- }
18
- })
19
- _type.addEventListener('change', ()=>{
20
- if (_type.value == 'AESEncode') {
21
- _case.classList.contains('hide') ? null : _case.classList.add('hide'); // 隐藏 大小写
22
- _code.classList.contains('hide') ? _code.classList.remove('hide') : null; // 显示
23
- _mode.classList.contains('hide') ? _mode.classList.remove('hide') : null;
24
- _pad.classList.contains('hide') ? _pad.classList.remove('hide') : null;
25
- _key.classList.contains('hide') ? _key.classList.remove('hide') : null;
26
- _iv.classList.contains('hide') ? _iv.classList.remove('hide') : null;
27
- } else if (_type.value == 'AESDecode') {
28
- _code.classList.contains('hide') ? null : _code.classList.add('hide'); // 隐藏 编码、大小写
29
- _case.classList.contains('hide') ? null : _case.classList.add('hide');
30
- _mode.classList.contains('hide') ? _mode.classList.remove('hide') : null; // 显示
31
- _pad.classList.contains('hide') ? _pad.classList.remove('hide') : null;
32
- _key.classList.contains('hide') ? _key.classList.remove('hide') : null;
33
- _iv.classList.contains('hide') ? _iv.classList.remove('hide') : null;
34
- } else {
35
- _code.classList.contains('hide') ? _code.classList.remove('hide') : null; // 显示
36
- _case.classList.contains('hide') ? _case.classList.remove('hide') : null;
37
- _mode.classList.contains('hide') ? null : _mode.classList.add('hide'); // 隐藏
38
- _pad.classList.contains('hide') ? null : _pad.classList.add('hide');
39
- _key.classList.contains('hide') ? null : _key.classList.add('hide');
40
- _iv.classList.contains('hide') ? null : _iv.classList.add('hide');
41
- }
42
- })
43
- _mode.addEventListener('change', ()=>{
44
- if (_mode.value != 'ECB') {
45
- if (_iv.classList.contains('lock')) {
46
- _iv.classList.remove('lock');
47
- _iv.disabled = false;
48
- };
49
- } else {
50
- if (!_iv.classList.contains('lock')) {
51
- _iv.classList.add('lock');
52
- _iv.disabled = true;
53
- };
54
- }
55
- })
56
-
57
- function copyTranscode() {
58
- textOut.select();
59
- document.execCommand('copy');
60
- }
61
-
62
- function clearTranscode() {
63
- document.querySelector('.encryption .inner').value = '';
64
- textOut.value = '';
65
- textOut.disabled = true;
66
- textOut.classList.add('lock');
67
- }
68
-
69
- function transcode() {
70
- var a = '',
71
- b = '',
72
- __mode = '',
73
- __pad = '',
74
- __text = '',
75
- __key = CryptoJS.enc.Utf8.parse(_key.value),
76
- __iv = CryptoJS.enc.Utf8.parse(_iv.value);
77
- switch (_mode.value) {
78
- case "CBC": __mode = CryptoJS.mode.CBC; break;
79
- case "CFB": __mode = CryptoJS.mode.CFB; break;
80
- case "CTR": __mode = CryptoJS.mode.CTR; break;
81
- case "OFB": __mode = CryptoJS.mode.OFB; break;
82
- case "ECB": __mode = CryptoJS.mode.ECB; break;
83
- default: __mode = CryptoJS.mode.CBC;
84
- }
85
- switch (_pad.value) {
86
- case "Pkcs7": __pad = CryptoJS.pad.Pkcs7; break;
87
- case "Iso97971": __pad = CryptoJS.pad.Iso97971; break;
88
- case "Iso10126": __pad = CryptoJS.pad.Iso10126; break;
89
- case "AnsiX923": __pad = CryptoJS.pad.AnsiX923; break;
90
- case "ZeroPadding": __pad = CryptoJS.pad.ZeroPadding; break;
91
- case "NoPadding": __pad = CryptoJS.pad.NoPadding; break;
92
- default: __pad = CryptoJS.pad.Pkcs7;
93
- }
94
- switch (_type.value) {
95
- case "MD5":
96
- a = CryptoJS.MD5(textIn.value);
97
- b = _code.value == 'Hex' ? a.toString() : CryptoJS.enc.Base64.stringify(a);
98
- textOut.value = _case.value == 'Lower' ? b : b.toUpperCase();
99
- break;
100
- case "SHA1":
101
- a = CryptoJS.SHA1(textIn.value);
102
- b = _code.value == 'Hex' ? a.toString() : CryptoJS.enc.Base64.stringify(a);
103
- textOut.value = _case.value == 'Lower' ? b : b.toUpperCase();
104
- break;
105
- case "SHA3":
106
- a = CryptoJS.SHA3(textIn.value);
107
- b = _code.value == 'Hex' ? a.toString() : CryptoJS.enc.Base64.stringify(a);
108
- textOut.value = _case.value == 'Lower' ? b : b.toUpperCase();
109
- break;
110
- case "SHA224":
111
- a = CryptoJS.SHA224(textIn.value);
112
- b = _code.value == 'Hex' ? a.toString() : CryptoJS.enc.Base64.stringify(a);
113
- textOut.value = _case.value == 'Lower' ? b : b.toUpperCase();
114
- break;
115
- case "SHA256":
116
- a = CryptoJS.SHA256(textIn.value);
117
- b = _code.value == 'Hex' ? a.toString() : CryptoJS.enc.Base64.stringify(a);
118
- textOut.value = _case.value == 'Lower' ? b : b.toUpperCase();
119
- break;
120
- case "SHA384":
121
- a = CryptoJS.SHA384(textIn.value);
122
- b = _code.value == 'Hex' ? a.toString() : CryptoJS.enc.Base64.stringify(a);
123
- textOut.value = _case.value == 'Lower' ? b : b.toUpperCase();
124
- break;
125
- case "SHA512":
126
- a = CryptoJS.SHA512(textIn.value);
127
- b = _code.value == 'Hex' ? a.toString() : CryptoJS.enc.Base64.stringify(a);
128
- textOut.value = _case.value == 'Lower' ? b : b.toUpperCase();
129
- break;
130
- case "RIPEMD160":
131
- a = CryptoJS.RIPEMD160(textIn.value);
132
- b = _code.value == 'Hex' ? a.toString() : CryptoJS.enc.Base64.stringify(a);
133
- textOut.value = _case.value == 'Lower' ? b : b.toUpperCase();
134
- break;
135
- case "AESEncode":
136
- __text = CryptoJS.enc.Utf8.parse(textIn.value);
137
- a = CryptoJS.AES.encrypt(__text, __key, { iv: __iv, mode: __mode, padding: __pad });
138
- b = _code.value == 'Hex' ? CryptoJS.enc.Hex.stringify(a.ciphertext) : a.toString();
139
- textOut.value = b;
140
- break;
141
- case "AESDecode":
142
- var base64Regex = /^[A-Za-z0-9+/]*={1,2}$/,
143
- hexRegex = /^(?:[0-9a-fA-F]{4})*$/;
144
- if (base64Regex.test(textIn.value)) {
145
- console.log('base64');
146
- __text = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Base64.parse(textIn.value));
147
- textOut.value = CryptoJS.AES.decrypt(__text, __key, { iv: __iv, mode: __mode, padding: __pad }).toString(CryptoJS.enc.Utf8);
148
- break;
149
- } else if (hexRegex.test(textIn.value)) {
150
- console.log('hex');
151
- __text = CryptoJS.enc.Hex.parse(textIn.value);
152
- textOut.value = CryptoJS.AES.decrypt({ ciphertext: __text }, __key, { iv: __iv, mode: __mode, padding: __pad }).toString(CryptoJS.enc.Utf8);
153
- break;
154
- } else {
155
- console.log('数据错误');
156
- alert('数据错误');break;
157
- }
158
- default: ;
159
- }
160
- textOut.disabled = false;
161
- textOut.classList.remove('lock');
162
- }