code: @Override
      public DigestCalculator get(final AlgorithmIdentifier algorithmIdentifier) throws OperatorCreationException
      {
          final Digest digest = getFactory(algorithmIdentifier.getAlgorithm()).getInstance();
  
          if (digest instanceof DigestCalculator) {
              return (DigestCalculator) digest;
          } else {
              return new DigestCalculator()
              {
                  @Override
                  public AlgorithmIdentifier getAlgorithmIdentifier()
                  {
                      return algorithmIdentifier;
                  }
  
                  @Override
                  public OutputStream getOutputStream()
                  {
                      return digest.getOutputStream();
                  }
  
                  @Override
                  public byte[] getDigest()
                  {
                      return digest.digest();
                  }
              };
          }
      }
docs: {@inheritDoc}
  
  @since 6.0M1