code: private function addDigest($message)
      {
          if (!array_search('digest', $this->headerList->names)) {
              $this->headerList->names[] = 'digest';
          }
          $message = $message->withoutHeader('Digest')
              ->withHeader(
                  'Digest',
                  'SHA-256='.base64_encode(hash('sha256', $message->getBody(), true))
              );
  
          return $message;
      }
docs: @param RequestInterface $message
  
  @return RequestInterface