git.delta.rocks / jrsonnet / refs/commits / 6639b028f560

difftreelog

feat enable std.sha2 by default

Yaroslav Bolyukin2023-06-14parent: #6344af1.patch.diff
in: master
Upstream issue: https://github.com/google/go-jsonnet/pull/699

3 files changed

modifiedcrates/jrsonnet-stdlib/Cargo.tomldiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/Cargo.toml
+++ b/crates/jrsonnet-stdlib/Cargo.toml
@@ -16,8 +16,6 @@
 legacy-this-file = []
 # Add order preservation flag to some functions
 exp-preserve-order = ["jrsonnet-evaluator/exp-preserve-order"]
-# Add nonstandard `std.sha256` function
-exp-more-hashes = ["dep:sha2"]
 # Bigint type
 exp-bigint = ["num-bigint", "jrsonnet-evaluator/exp-bigint"]
 
@@ -34,6 +32,8 @@
 
 # std.md5
 md5 = "0.7.0"
+# std.sha256, std.sha512
+sha2 = "0.10.6"
 # std.base64
 base64 = "0.21.0"
 # std.parseJson
@@ -41,7 +41,6 @@
 # std.parseYaml, custom library fork is used for C++/golang compatibility
 serde_yaml_with_quirks = "0.8.24"
 
-sha2 = { version = "0.10.6", optional = true }
 num-bigint = { version = "0.4.3", optional = true }
 
 [build-dependencies]
modifiedcrates/jrsonnet-stdlib/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/lib.rs
+++ b/crates/jrsonnet-stdlib/src/lib.rs
@@ -114,7 +114,6 @@
 		("set", builtin_set::INST),
 		// Hash
 		("md5", builtin_md5::INST),
-		#[cfg(feature = "exp-more-hashes")]
 		("sha256", builtin_sha256::INST),
 		// Encoding
 		("encodeUTF8", builtin_encode_utf8::INST),
modifieddocs/features.mddiffbeforeafterboth
154}154}
155```155```
156156
157## `exp-more-hashes`
158
159Adds new standard library function: `std.sha256`, upstream issue: https://github.com/google/jsonnet/pull/607
160157