protected static MessageDigest prepareMessageDigest(final String principal, final String service) {
        return FunctionUtils.doUnchecked(() -> {
            val md = MessageDigest.getInstance("SHA");
            if (StringUtils.isNotBlank(service)) {
                md.update(service.getBytes(StandardCharsets.UTF_8));
                md.update(CONST_SEPARATOR);
            }
            md.update(principal.getBytes(StandardCharsets.UTF_8));
            md.update(CONST_SEPARATOR);
            return md;
        });
    }
Prepare message digest message digest.

@param principal the principal
@param service   the service
@return the message digest
core/cas-server-core-services-api/src/main/java/org/apereo/cas/authentication/principal/ShibbolethCompatiblePersistentIdGenerator.java