feat: u2f

This commit is contained in:
2021-07-03 00:15:32 +08:00
parent c6ee7ab43a
commit 1e3fa35bdf
7 changed files with 311 additions and 126 deletions

7
src/digest.rs Normal file
View File

@@ -0,0 +1,7 @@
use sha2::{Digest, Sha256};
pub fn sha256(input: &str) -> Vec<u8> {
let mut challenge = Sha256::default();
Digest::update(&mut challenge, input.as_bytes());
challenge.finalize().to_vec()
}