MCPcopy Create free account
hub / github.com/3eif/gitmotion / derive_key

Function derive_key

api/src/main.rs:89–95  ·  view source on GitHub ↗
(secret_key: &str)

Source from the content-addressed store, hash-verified

87type JobStore = Arc<Mutex<HashMap<String, JobStatus>>>;
88
89fn derive_key(secret_key: &str) -> Vec<u8> {
90 let mut hasher = Sha256::new();
91 hasher.input_str(secret_key);
92 let mut hashed_key = vec![0; 32];
93 hasher.result(&mut hashed_key);
94 hashed_key
95}
96
97fn decrypt_token(encrypted_token: &str, secret_key: &str) -> Result<String, GourceError> {
98 let parts: Vec<&str> = encrypted_token.split(':').collect();

Callers 1

decrypt_tokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected