public static String digest ( CharSequence self , String algorithm ) throws NoSuchAlgorithmException { final String text = self . toString ( ) ; return digest ( text . getBytes ( StandardCharsets . UTF_8 ) , algorithm ) ; }
digest the CharSequence instance