diff options
| author | Xe Iaso <me@christine.website> | 2022-10-30 14:22:56 -0400 |
|---|---|---|
| committer | Xe Iaso <me@christine.website> | 2022-10-30 14:22:56 -0400 |
| commit | c654d84537a50e164c57852fc89216eec8e55d69 (patch) | |
| tree | 7844201ca37fe998309f81b000dc86477d05e4ca /src/lib.rs | |
| parent | 79a0a167ee87e925091a55f7de88d02bcea42c92 (diff) | |
| download | xesite-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.rs | 7 |
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()) +} |
