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

Make SHA1Hash a full fledged class

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.16, 3.4.6, 3.5.4
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v3.4, v3.2
    • Sprint:
      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

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: