Explore Enterprise Education Gitee Premium Gitee AI AI teammates
Fetch the repository succeeded.
Donate
Please sign in before you donate.
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
1 Star 0 Fork 1.2K

bobob/flowable

forked from bruce/flowable
Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
Already have an account? Sign in
文件
master
Branches (4)
Tags (3)
master
vben-upgrade-bpmnDesigner
flow-7.0
flow-systemSetting
springboot
bpmn.js
flowable
master
Branches (4)
Tags (3)
master
vben-upgrade-bpmnDesigner
flow-7.0
flow-systemSetting
springboot
bpmn.js
flowable
Clone or Download
Clone/Download
Prompt
To download the code, please copy the following command and execute it in the terminal
To ensure that your submitted code identity is correctly recognized by Gitee, please execute the following command.
When using the SSH protocol for the first time to clone or push code, follow the prompts below to complete the SSH configuration.
1 Generate RSA keys.
2 Obtain the content of the RSA public key and configure it in SSH Public Keys
To use SVN on Gitee, please visit the usage guide
When using the HTTPS protocol, the command line will prompt for account and password verification as follows. For security reasons, Gitee recommends configure and use personal access tokens instead of login passwords for cloning, pushing, and other operations.
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # Private Token
master
Branches (4)
Tags (3)
master
vben-upgrade-bpmnDesigner
flow-7.0
flow-systemSetting
springboot
bpmn.js
flowable
cipher.ts 3.73 KB
Copy Edit Raw Blame History
XIETONGJIAN authored 2024年03月04日 17:50 +08:00 . fix:前端页面升级
import { decrypt as aesDecrypt, encrypt as aesEncrypt } from 'crypto-js/aes';
import UTF8, { parse } from 'crypto-js/enc-utf8';
import pkcs7 from 'crypto-js/pad-pkcs7';
import CTR from 'crypto-js/mode-ctr';
import Base64 from 'crypto-js/enc-base64';
import MD5 from 'crypto-js/md5';
import SHA256 from 'crypto-js/sha256';
import SHA512 from 'crypto-js/sha512';
// Define an interface for encryption
// 定义一个加密器的接口
export interface Encryption {
encrypt(plainText: string): string;
decrypt(cipherText: string): string;
}
// Define an interface for Hashing
// 定义一个哈希算法的接口
export interface Hashing {
hash(data: string): string;
}
export interface EncryptionParams {
key: string;
iv: string;
}
class AesEncryption implements Encryption {
private readonly key;
private readonly iv;
constructor({ key, iv }: EncryptionParams) {
this.key = parse(key);
this.iv = parse(iv);
}
get getOptions() {
return {
mode: CTR,
padding: pkcs7,
iv: this.iv,
};
}
encrypt(plainText: string) {
return aesEncrypt(plainText, this.key, this.getOptions).toString();
}
decrypt(cipherText: string) {
return aesDecrypt(cipherText, this.key, this.getOptions).toString(UTF8);
}
}
// Define a singleton class for Base64 encryption
class Base64Encryption implements Encryption {
private static instance: Base64Encryption;
private constructor() {}
// Get the singleton instance
// 获取单例实例
public static getInstance(): Base64Encryption {
if (!Base64Encryption.instance) {
Base64Encryption.instance = new Base64Encryption();
}
return Base64Encryption.instance;
}
encrypt(plainText: string) {
return UTF8.parse(plainText).toString(Base64);
}
decrypt(cipherText: string) {
return Base64.parse(cipherText).toString(UTF8);
}
}
// Define a singleton class for MD5 Hashing
class MD5Hashing implements Hashing {
private static instance: MD5Hashing;
private constructor() {}
// Get the singleton instance
// 获取单例实例
public static getInstance(): MD5Hashing {
if (!MD5Hashing.instance) {
MD5Hashing.instance = new MD5Hashing();
}
return MD5Hashing.instance;
}
hash(plainText: string) {
return MD5(plainText).toString();
}
}
// Define a singleton class for SHA256 Hashing
class SHA256Hashing implements Hashing {
private static instance: SHA256Hashing;
private constructor() {}
// Get the singleton instance
// 获取单例实例
public static getInstance(): SHA256Hashing {
if (!SHA256Hashing.instance) {
SHA256Hashing.instance = new SHA256Hashing();
}
return SHA256Hashing.instance;
}
hash(plainText: string) {
return SHA256(plainText).toString();
}
}
// Define a singleton class for SHA512 Hashing
class SHA512Hashing implements Hashing {
private static instance: SHA512Hashing;
private constructor() {}
// Get the singleton instance
// 获取单例实例
public static getInstance(): SHA256Hashing {
if (!SHA512Hashing.instance) {
SHA512Hashing.instance = new SHA512Hashing();
}
return SHA512Hashing.instance;
}
hash(plainText: string) {
return SHA512(plainText).toString();
}
}
export class EncryptionFactory {
public static createAesEncryption(params: EncryptionParams): Encryption {
return new AesEncryption(params);
}
public static createBase64Encryption(): Encryption {
return Base64Encryption.getInstance();
}
}
export class HashingFactory {
public static createMD5Hashing(): Hashing {
return MD5Hashing.getInstance();
}
public static createSHA256Hashing(): Hashing {
return SHA256Hashing.getInstance();
}
public static createSHA512Hashing(): Hashing {
return SHA512Hashing.getInstance();
}
}
Loading...
Report
Report success
We will send you the feedback within 2 working days through the letter!
Please fill in the reason for the report carefully. Provide as detailed a description as possible.
Please select a report type
Cancel
Send
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

About

企业级流程中心(基于flowable和bpmn.js封装的流程引擎,采用Springboot,Mybatis-plus, Ehcache, sa-token 等框架技术,前端采用Vue3&Antd,Vben) 后端程序是https://openadmin.bpmport.com 前端程序是https://openportal.bpmport.com
Cancel

Releases

No release

Contributors

All

Activities

can not load any more
Edit
About
Homepage
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/httpsgithubcom/flow.git
git@gitee.com:httpsgithubcom/flow.git
httpsgithubcom
flow
flowable
master
Going to Help Center

Search

Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register

AltStyle によって変換されたページ (->オリジナル) /