Generate a cryptographic-safe value suitable for PKCE.
Generate a code challenge from a code verifier for PKCE.
The code verifier.
The hashing method.
Can either be plain
or S256
. For maximum security, prefer S256
.
Return the validation hash of a value.
Useful to check the validity c_hash
and at_hash
claims.
The value to hash.
The hashed value.
Check if a hash corresponds to the provided value.
Useful to check the validity c_hash
and at_hash
claims.
The plain value to challenge.
The hash to compare with.
If the hash is valid.
Interface that should follow a class to implement a crypto helper.
It's useful because we have different implementations in browser and NodeJS.