class Sha1Tools {

    public static String sha1(final String input) {
        try {
            final MessageDigest crypt = MessageDigest.getInstance("SHA-1");
            crypt.reset();
            crypt.update(input.getBytes("UTF-8"));
            return byteToHex(crypt.digest());
        }
        catch (final NoSuchAlgorithmException | UnsupportedEncodingException exception) {
            throw new RuntimeException(exception.getMessage(), exception);
        }
    }

}