Sha256Utils { public static String mask(final CharSequence raw) { if (null == raw) { return null; } final StringBuilder buffer = new StringBuilder(raw.length()); for (int i = 0; i < raw.length(); ++i) { buffer.append("*"); } return buffer.toString(); }  static byte[] getBytes(CharSequence str); static byte[] digest(final byte[] raw); static byte[] digest(final byte[]... raws); static String mask(final CharSequence raw);  }
@Test public void testMask() throws Exception { assertNull(Sha256Utils.mask(null)); assertTrue(Sha256Utils.mask(randomUUID().toString()).contains("**")); }