Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-28052

Make SHA1Hash a full fledged class

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.2.16, 3.4.6, 3.5.4
    • None
    • None
    • Fully Compatible
    • v3.4, v3.2
    • Sharding 2017-03-06

    Description

      class SHA1Hash {
      public:
          static StatusWith<SHA1Hash> fromBuffer(const uint8_t* input, size_t
      inputLen);
       
          // The current factory functions
          static SHA1Hash computeHash(const uint8_t* input, size_t inputLen);
          static SHA1Hash computeHmac(const uint8_t* key, size_t keyLen, const
      uint8_t* input, size_t inputLen);
       
          const uint8_t* data() const { return _hash.data(); }
          size_t size() const { return _hash.size(); }
       
          std::array<uint8_t, 20> asArray() const { return _hash; }
       
          std::toString() const;
          bool operator==(const SHA1Hash& rhs) const;
       
      private:
          SHA1Hash() = default;
          
          std::array<uint8_t, 20> _hash;
      };
      

      Attachments

        Activity

          People

            randolph@mongodb.com Randolph Tan
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: