Crates.io | pkce |
lib.rs | pkce |
version | 0.2.0 |
source | src |
created_at | 2020-07-13 18:50:01.0548 |
updated_at | 2023-02-26 05:21:08.001422 |
description | Library for generating PKCE code verifiers and challenges |
homepage | |
repository | https://github.com/StargazerG/pkce-rs |
max_upload_size | |
id | 264787 |
size | 5,903 |
A very simple library for generating code verifiers and challenges to use for OAuth Proof Key for Code Exchange. It is not rocket science.
extern crate pkce;
fn main() {
// Generate a random 128-byte code verifier (must be between 43 and 128 bytes)
let code_verify = pkce::code_verifier(128);
// Generate an encrypted code challenge accordingly
let code_challenge = pkce::code_challenge(&code_verify);
println!("Code challenge generated: {}", code_challenge);
}
Wow, it really is that simple.
In order to support WebAssembly enable feature js
.