File tree 5 files changed +67
-8
lines changed
5 files changed +67
-8
lines changed Original file line number Diff line number Diff line change 10
10
11
11
- [x] 中文/UTF-8互转
12
12
13
+ - [x] Base64编码/解码
14
+
13
15
- [ ] AES/DES加解密
14
16
15
17
- [ ] MD5、SHA加密
16
18
17
- - [ ] Base64编码/解码
18
-
19
19
# 开发
20
20
21
21
``` bash
@@ -32,7 +32,7 @@ Bootstrap5终于不再需要jquery了,可以和Vue一起用:
32
32
33
33
``` bash
34
34
npm i -D electron
35
- npm i vue bootstrap @popperjs/core
35
+ npm i vue bootstrap @popperjs/core crypto-js
36
36
```
37
37
38
38
# 发行版打包
@@ -58,6 +58,10 @@ npm run build-dist:win
58
58
59
59
![ image-20220913162817293] ( https://imgbd.r-xnoro.com//image-20220913162817293.png )
60
60
61
+ ## Base64编码/解码
62
+
63
+ ![ image-20220913170027407] ( https://imgbd.r-xnoro.com//image-20220913170027407.png )
64
+
61
65
## 随机数/密码生成器
62
66
63
67
![ image-20220913152551500] ( https://imgbd.r-xnoro.com//image-20220913152551500.png )
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " coderbox" ,
3
- "version" : " 1.0.5 " ,
3
+ "version" : " 1.0.6 " ,
4
4
"description" : " 基于electron的跨平台的程序员小工具集" ,
5
5
"main" : " main.js" ,
6
6
"scripts" : {
30
30
"keywords" : [
31
31
" coderbox" ,
32
32
" 加密" ,
33
- " 编码"
33
+ " 编码" ,
34
+ " base64"
34
35
],
35
36
"author" : " lizl6" ,
36
37
"license" : " Apache-2.0" ,
40
41
"dependencies" : {
41
42
"@popperjs/core" : " ^2.11.6" ,
42
43
"bootstrap" : " ^5.2.0" ,
44
+ "crypto-js" : " ^4.1.1" ,
43
45
"vue" : " ^3.2.38"
44
46
}
45
47
}
Original file line number Diff line number Diff line change
1
+ < link rel ="stylesheet " href ="../index.css ">
2
+ < link rel ="stylesheet " href ="../../node_modules/bootstrap/dist/css/bootstrap.min.css ">
3
+ < div class ="container-fluid " id ="app ">
4
+ < div class ="card bg-light text-gray ">
5
+ < div class ="card-head text-muted "> Base64编码/解码</ div >
6
+ </ div >
7
+ < div class ="row pt-2 ">
8
+ < div class ="col-1 text-end "> 原文:</ div >
9
+ < div class ="col "> < textarea class ="form-control " style ="resize:none; " v-model ="strNative " cols ="30 " rows ="10 "> </ textarea > </ div >
10
+ </ div >
11
+ < div class ="row mt-3 ">
12
+ < div class ="col-1 "> </ div >
13
+ < div class ="col ">
14
+ < button type ="button " class ="btn btn-primary " @click ="encode "> Base64编码⇩</ button >
15
+ < button type ="button " class ="btn btn-primary " style ="margin-left:15px; " @click ="decode "> Base64解码⇧</ button >
16
+ </ div >
17
+ </ div >
18
+ < div class ="row mt-3 ">
19
+ < div class ="col-1 text-end text-nowrap "> 密文:</ div >
20
+ < div class ="col "> < textarea class ="form-control " style ="resize:none; " v-model ="strCypher " cols ="30 " rows ="10 "> </ textarea > </ div >
21
+ </ div >
22
+ </ div >
23
+ < script src ="../../node_modules/bootstrap/dist/js/bootstrap.bundle.min.js "> </ script >
24
+ < script src ="../../node_modules/crypto-js/crypto-js.js "> </ script >
25
+ < script src ="../../node_modules/vue/dist/vue.global.prod.js "> </ script >
26
+ < script >
27
+ const app = {
28
+ data ( ) {
29
+ return {
30
+ strNative : '' ,
31
+ strCypher : ''
32
+ }
33
+ } ,
34
+ methods : {
35
+ encode ( ) {
36
+ if ( this . strNative == '' ) return ;
37
+ let str = CryptoJS . enc . Utf8 . parse ( this . strNative ) ;
38
+ this . strCypher = CryptoJS . enc . Base64 . stringify ( str ) ;
39
+ } ,
40
+ decode ( ) {
41
+ if ( this . strCypher == '' ) return ;
42
+ let words = CryptoJS . enc . Base64 . parse ( this . strCypher ) ;
43
+ this . strNative = words . toString ( CryptoJS . enc . Utf8 ) ;
44
+ }
45
+ }
46
+ }
47
+ Vue . createApp ( app ) . mount ( '#app' ) ;
48
+ </ script >
Original file line number Diff line number Diff line change 21
21
< div class ="dropdown-menu ">
22
22
< a href ="# " class ="dropdown-item " @click ="to('ascii') "> 中文/ASCii互转</ a >
23
23
< a href ="# " class ="dropdown-item " @click ="to('utf8') "> 中文/UTF-8互转</ a >
24
- < a href ="# " class ="dropdown-item "> Base64编码/解码</ a >
25
- < a href ="# " class ="dropdown-item "> MD5、SHA加密 </ a >
26
- < a href ="# " class ="dropdown-item "> AES/DES加解密</ a >
24
+ < a href ="# " class ="dropdown-item " @click =" to('base64') " > Base64编码/解码</ a >
25
+ <!-- < a href="#" class="dropdown-item">散列/哈希加密 </a>
26
+ <a href="#" class="dropdown-item">AES/DES加解密</a> -->
27
27
</ div >
28
28
</ li >
29
29
< li class ="nav-item ">
Original file line number Diff line number Diff line change @@ -21,6 +21,11 @@ const app = {
21
21
name : 'utf8' ,
22
22
path : './component/utf8.html' ,
23
23
state : 0
24
+ } ,
25
+ {
26
+ name : 'base64' ,
27
+ path : './component/base64.html' ,
28
+ state : 0
24
29
}
25
30
] ,
26
31
dataPwd : {
You can’t perform that action at this time.
0 commit comments