Here you can find the source of sha1_b64(final String text)
public static String sha1_b64(final String text)
//package com.java2s; //License from project: Apache License import java.security.MessageDigest; import java.util.Base64; public class Main { public static String sha1_b64(final String text) { try {/*from w ww.ja v a 2s .c o m*/ final byte[] bytesOfMessage = text.getBytes(); final MessageDigest md = MessageDigest.getInstance("SHA1"); final byte[] digest = md.digest(bytesOfMessage); return base64encode(digest); } catch (Exception e) { throw new RuntimeException(); } } public static String base64encode(final byte[] data) { final Base64.Encoder encoder = Base64.getEncoder(); return encoder.encodeToString(data); } public static String base64encode(final String text) { final Base64.Encoder encoder = Base64.getEncoder(); return encoder.encodeToString(text.getBytes()); } }