Created
July 17, 2013 14:20
-
-
Save aegis123/6020974 to your computer and use it in GitHub Desktop.
encode a string with Base64 url safe and no padding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
byte[] digist; | |
Base64.encodeToString(digest, Base64.URL_SAFE | Base64.NO_PADDING); |
new String(Base64.getUrlEncoder().encode(digest)).split("=")[0] //remove padding
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For Java8+ ...
... and ...