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

Supports encoding and decoding of java-encoded base64 safe url characters #215

Closed
wants to merge 2 commits into from
Closed

Conversation

det101
Copy link

@det101 det101 commented Apr 26, 2019

Supports encoding and decoding of java-encoded base64 safe url characters
org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString
example javaer output key='u-rXsDG_aegAnzC_CJt27plLGNqOfR****5o2ro1NOI';

@det101
Copy link
Author

det101 commented Jan 19, 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

@det101 det101 closed this Jan 19, 2020
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.

1 participant