-
Notifications
You must be signed in to change notification settings - Fork 1
/
Cargo.toml
95 lines (84 loc) · 3.41 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
[package]
name = "sqlite-hashes"
version = "0.7.8" # This value is also used in the README.md
description = "Hashing functions for SQLite with aggregation support: MD5, SHA1, SHA256, SHA512, FNV-1a, xxHash"
authors = ["Yuri Astrakhan <[email protected]>"]
repository = "https://github.com/nyurik/sqlite-hashes"
edition = "2021"
license = "MIT OR Apache-2.0"
keywords = ["sqlite", "rusqlite", "hash", "md5", "sha256"]
categories = ["database", "cryptography"]
rust-version = "1.77.2"
[lib]
name = "sqlite_hashes"
# Loadable extenios is a cdylib (lib), but Rust does not allow multiple libs per crate, so using an example instead.
# See https://github.com/rust-lang/cargo/issues/8628
[[example]]
name = "sqlite_hashes"
path = "src/cdylib/cdylib.rs"
crate-type = ["cdylib"]
required-features = ["loadable_extension"]
[features]
default = ["trace", "aggregate", "window", "hex", "md5", "sha1", "sha224", "sha256", "sha384", "sha512", "fnv", "xxhash"]
# Use this feature to build loadable extension.
# Assumes --no-default-features.
# Does not support windowing functionality yet.
default_loadable_extension = ["loadable_extension", "aggregate", "hex", "md5", "sha1", "sha224", "sha256", "sha384", "sha512", "fnv", "xxhash"]
#
# Enable Trace Logging
trace = ["dep:hex", "dep:log"]
#
# Enable HEX-outputing variants like *_hex() and *_concat_hex() (with "aggregate" feature)
hex = ["dep:hex"]
#
# Enable aggregate functions
aggregate = []
#
# Enable window functions in addition to aggregate functions. Uses bundled SQLite. Not supported with loadable extension.
window = ["aggregate", "rusqlite/bundled", "rusqlite/window"]
# "rusqlite/bundled", "rusqlite/modern_sqlite"
#
# Build loadable extension. Not compatible with the window feature.
# See https://github.com/rusqlite/rusqlite/discussions/1423
# This feature does not work with "rusqlite/modern_sqlite", "window"
loadable_extension = ["rusqlite/loadable_extension", "rusqlite/trace"]
#
# Hashing algorithms
md5 = ["dep:md-5"]
sha1 = ["dep:sha1"]
sha224 = ["dep:sha2"]
sha256 = ["dep:sha2"]
sha384 = ["dep:sha2"]
sha512 = ["dep:sha2"]
fnv = ["dep:noncrypto-digests", "noncrypto-digests?/fnv"]
xxhash = ["dep:noncrypto-digests", "noncrypto-digests?/xxh3", "noncrypto-digests?/xxh32", "noncrypto-digests?/xxh64"]
[dependencies]
hex = { version = "0.4", optional = true }
log = { version = "0.4.22", optional = true }
# There are multiple versions that could work, but sqlx requires a specific one, so don't limit it here
# Note that cdylib requires >= 0.32 (controlled by the lock file)
rusqlite = { version = ">=0.30", features = ["functions"] }
# Digest and all hashing algorithms are using the same crates internally, so should be kept in sync
digest = "0.10.7"
md-5 = { version = "0.10.6", optional = true }
sha1 = { version = "0.10.6", optional = true }
sha2 = { version = "0.10.8", optional = true }
noncrypto-digests = { version = "0.3.2", optional = true }
[dev-dependencies]
cargo-husky = { version = "1", features = ["user-hooks"], default-features = false }
criterion = { version = "0.5", features = ["html_reports"] }
ctor = "0.2"
env_logger = "0.11"
insta = { version = "1", features = [] }
[lints.rust]
unused_qualifications = "warn"
[lints.clippy]
pedantic = { level = "warn", priority = -1 }
missing_errors_doc = "allow"
module_name_repetitions = "allow"
[[bench]]
name = "bench"
harness = false
#[patch.crates-io]
#rusqlite = { path = "../rusqlite" }
#libsqlite3-sys = { path = "../rusqlite/libsqlite3-sys" }