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

Make SHA1Hash a full fledged class

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.2.16, 3.4.6, 3.5.4
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • v3.4, v3.2
    • Sharding 2017-03-06

      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;
      };
      

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

              Created:
              Updated:
              Resolved: