From 92c89e9ceb50ecabaaf42e83924ba3f33323ae34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Thu, 29 Jun 2023 13:29:31 +0800 Subject: [PATCH] =?UTF-8?q?build(init):=E5=88=9D=E5=A7=8B=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=BB=93=E6=9E=84=E5=BB=BA=E7=AB=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 260 ++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 8 ++ README.md | 33 +++++ src/encryption/mod.rs | 0 src/hash/mod.rs | 0 src/lib.rs | 5 + src/serial_code/mod.rs | 0 src/signature/mod.rs | 0 src/verifiy_code/mod.rs | 0 9 files changed, 306 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.toml create mode 100644 README.md create mode 100644 src/encryption/mod.rs create mode 100644 src/hash/mod.rs create mode 100644 src/lib.rs create mode 100644 src/serial_code/mod.rs create mode 100644 src/signature/mod.rs create mode 100644 src/verifiy_code/mod.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c33d591 --- /dev/null +++ b/.gitignore @@ -0,0 +1,260 @@ +/target +/Cargo.lock + +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +# Prerequisites +*.d + +# Object files +*.o +*.ko +*.obj +*.elf + +# Linker output +*.ilk +*.map +*.exp + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ +*.su +*.idb +*.pdb + +# Kernel Module Compile Results +*.mod* +*.cmd +.tmp_versions/ +modules.order +Module.symvers +Mkfile.old +dkms.conf + +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..3b699e0 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "toolbox" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/README.md b/README.md new file mode 100644 index 0000000..848c7c8 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# 常用功能工具箱 + +Rust 中可以使用的常用辅助功能工具箱。主要配备以下功能: + +- 加解密算法 + - [ ] 随机密钥自解密算法 + - [ ] AES-CBC 便捷加解密算法 + - [ ] ZerosPadding + - [ ] Pkcs7Padding + - [ ] AES-GCM 便捷加解密算法 + - [ ] DES-CBC 便捷加解密算法 + - [ ] ZerosPadding + - [ ] Pkcs7Padding + - [ ] 3DES 便捷加解密算法 +- 散列算法。 + - [ ] Sha512 散列算法 + - [ ] Sha1 散列算法 + - [ ] MD5 散列算法 + - [ ] 图像感知散列算法 +- 唯一序列号生成器 + - [ ] 改进版雪花 ID 生成器(短主机精简日期版) + - [ ] UUID 生成器 + - [ ] short UUID 生成器 + - [ ] GUID 生成器 +- 签名算法 + - [ ] RSA 签名算法 +- 验证码生成器 + - [ ] 随机验证码生成算法 +- 序列化算法 + - [ ] Base64 算法 + - [ ] Hex 直转 + +本工具箱仅可支持于 Rust 程序中使用,可以编译为`rlib`或者`dylib`。 diff --git a/src/encryption/mod.rs b/src/encryption/mod.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/hash/mod.rs b/src/hash/mod.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..4dbef6b --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,5 @@ +pub mod encryption; +pub mod hash; +pub mod serial_code; +pub mod signature; +pub mod verifiy_code; diff --git a/src/serial_code/mod.rs b/src/serial_code/mod.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/signature/mod.rs b/src/signature/mod.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/verifiy_code/mod.rs b/src/verifiy_code/mod.rs new file mode 100644 index 0000000..e69de29