Skip to content

Commit

Permalink
Merge pull request #1148 from jiangliu/utils-crypt
Browse files Browse the repository at this point in the history
utils: introduce methods and structures for encryption and decryption
  • Loading branch information
jiangliu authored Mar 15, 2023
2 parents eb042ca + a6cecb9 commit 6638eee
Show file tree
Hide file tree
Showing 6 changed files with 564 additions and 6 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ libc = "0.2"
log = "0.4"
lz4-sys = "1.9.4"
lz4 = "1.24.0"
openssl = { version = "0.10.45", features = ["vendored"], optional = true }
serde = { version = ">=1.0.27", features = ["serde_derive", "rc"] }
serde_json = ">=1.0.9"
sha2 = "0.10.0"
Expand All @@ -38,6 +39,7 @@ tar = "0.4.38"

[features]
zran = ["libz-sys"]
encryption = ["openssl"]

[package.metadata.docs.rs]
all-features = true
Expand Down
9 changes: 5 additions & 4 deletions utils/src/compress/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ pub mod zlib_random;
const COMPRESSION_MINIMUM_RATIO: usize = 100;

/// Supported compression algorithms.
#[repr(u32)]
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub enum Algorithm {
None,
Lz4Block,
GZip,
Zstd,
None = 0,
Lz4Block = 1,
GZip = 2,
Zstd = 3,
}

impl Default for Algorithm {
Expand Down
Loading

0 comments on commit 6638eee

Please sign in to comment.