aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorXe Iaso <me@christine.website>2022-10-30 14:22:56 -0400
committerXe Iaso <me@christine.website>2022-10-30 14:22:56 -0400
commitc654d84537a50e164c57852fc89216eec8e55d69 (patch)
tree7844201ca37fe998309f81b000dc86477d05e4ca /src/lib.rs
parent79a0a167ee87e925091a55f7de88d02bcea42c92 (diff)
downloadxesite-c654d84537a50e164c57852fc89216eec8e55d69.tar.xz
xesite-c654d84537a50e164c57852fc89216eec8e55d69.zip
start working on a mastodon post embed tag
Signed-off-by: Xe Iaso <me@christine.website>
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
new file mode 100644
index 0000000..1fc1661
--- /dev/null
+++ b/src/lib.rs
@@ -0,0 +1,7 @@
+use sha2::{Digest, Sha256};
+
+pub fn hash_string(inp: String) -> String {
+ let mut h = Sha256::new();
+ h.update(&inp.as_bytes());
+ hex::encode(h.finalize())
+}