code: public String getTypeAndIdHash() {
          assert (entityType != null);
          assert (id != null);
          String idStr = id.replaceAll("\\W", "__");
          return entityType.toString().toLowerCase() + "_" + idStr;
      }
docs: Compute a hash based on type and ID to uniquely identify this bean. This method helps avoid
  the unlikely case where a group and person in the same principal list have the same ID.
  
  <p>Periods are replaced to avoid issues in JSP EL and form names can't contain spaces. Also
  SpEL parsing of form field names fails with characters such as dash or parenthesis (which
  PAGS groups can have) and likely other characters so they are also replaced with underscores.
  
  @return EntityType + "_" + ID