@Override
    public InstanceId generateId(final Registration registration) {
        val serverName = StringUtils.defaultIfEmpty(registration.getMetadata().get("name"), casProperties.getHost().getName());
        val registrationHashKey = registration.getHealthUrl() + '-' + Objects.requireNonNull(serverName,
            "Server name cannot be undefined. Instance registration metadata must include a name in CAS configuration or [cas.host.name=...] must be defined.");
        val instanceId = StringUtils.substring(DigestUtils.sha256(registrationHashKey), 0, INSTANCE_ID_LENGTH);
        return InstanceId.of(instanceId);
    }
This is {@link CasServerInstanceIdGenerator}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-bootadmin/src/main/java/org/apereo/cas/sba/CasServerInstanceIdGenerator.java