Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add safe url Base64 codec #253

Closed
wants to merge 2 commits into from
Closed

add safe url Base64 codec #253

wants to merge 2 commits into from

Conversation

det101
Copy link

@det101 det101 commented Jan 20, 2020

    var message = "https://github.com/";
    var key = "u-rXsMB_aegAnzC_CJt27plLGNqOfR2EHI5o2ro1NOI";
    var baseKey = CryptoJS.enc.Base64.parse(key, true);
    console.log("key:"+baseKey.toString());
    var hash = CryptoJS.HmacSHA256(message, baseKey);
    var hashInBase64 = CryptoJS.enc.Base64.stringify(hash);
     console.log("result", hashInBase64);
    var shashInBase64 = CryptoJS.enc.Base64.stringify(hash, true);
    console.log("safe result:"+hash.toString())
    document.write(shashInBase64);

issue #252
fixed #252

@evanvosberg
Copy link
Member

I do understand the goal this, but I would not modify the existing enc.Base64 module for. I would rather prefer to create a new module named enc.Base64url.

@evanvosberg
Copy link
Member

Dedicated Base64url encoding has been added in the 4.1 release.

@evanvosberg evanvosberg closed this Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Base64 does not support url_safe codec
2 participants