mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 19:00:18 +00:00
feat(autoconfigure): generate names using a unique hash
This commit is contained in:
@@ -175,3 +175,9 @@ pub fn combine_options<T: AsRef<str>>(options: impl Iterator<Item = T>) -> Strin
|
||||
.collect::<Vec<_>>()
|
||||
.join(" ")
|
||||
}
|
||||
|
||||
/// Produce a unique hash for the input.
|
||||
/// This uses SHA-256, which is unique enough but relatively short.
|
||||
pub fn unique_hash(input: &str) -> String {
|
||||
sha256::digest(input.as_bytes())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user