I have the following code:
import Base64url from "crypto-js/enc-base64url"
import SHA256 from "crypto-js/sha256";
//...
const codeVerifier = "test-value";
const hashed = SHA256(codeVerifier);
console.log({ sha256: hashed.toString() });
// output: sha256: 5b1406fffc9de5537eb35a845kc99521f26fba0e772d58b42e09f4221b9e043ae
console.log({ base64: Base64url.stringify(hashed) })
// output: base64: WxQG__yd5VN-s1qEXJlSHyb7oOdy1YtC4J9CIbngQ64
// expected: base64: NWIxNDA2ZmZmYzlkZTU1MzdlYjM1YTg0NWM5OTUyMWYyNmZiYTBlNzcyZDU4YjQyZTA5ZjQyMjFiOWUwNDNhZQ
As you can see the output that I'm getting is incorrect (I used an online base64url generator to validate, such as this one). I'm guessing I'm doing something wrong here, but I can't see it. I read the documentation and couldn't find anything.
I've prepared a small codesandbox if it helps.