@Override
    public String generate(final String principal, final String service) {
        if (StringUtils.isBlank(salt)) {
            this.salt = new DefaultRandomStringGenerator(CONST_DEFAULT_SALT_COUNT).getNewString();
        }
        LOGGER.debug("Using principal [{}] to generate anonymous identifier for service [{}]", principal, service);

        val md = prepareMessageDigest(principal, service);
        val result = digestAndEncodeWithSalt(md);
        LOGGER.debug("Generated persistent id for [{}] is [{}]", service, result);
        return result;
    }
Prepare message digest message digest.

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