summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/hashing.h
diff options
context:
space:
mode:
author Miodrag Milanović <mmicko@gmail.com>2016-01-11 09:18:43 +0100
committer Miodrag Milanović <mmicko@gmail.com>2016-01-11 09:18:43 +0100
commit36195292e370de0fb6b32085c105a236995ce36e (patch)
tree1fb147c3e21824272b60e4989f606bc9c206030c /src/lib/util/hashing.h
parent7c944fa3b02cd26dec3c27f1e6a4c0d33f462c4e (diff)
parent115db95642ad6d861aad63775b92350e0491f2dd (diff)
Merge pull request #561 from ajrhacker/strings
Return std::string objects by value rather than pass by reference [ajrhacker]
Diffstat (limited to 'src/lib/util/hashing.h')
-rw-r--r--src/lib/util/hashing.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/util/hashing.h b/src/lib/util/hashing.h
index b0de6a5c3c8..51a7da7c694 100644
--- a/src/lib/util/hashing.h
+++ b/src/lib/util/hashing.h
@@ -34,7 +34,7 @@ struct sha1_t
bool operator!=(const sha1_t &rhs) const { return memcmp(m_raw, rhs.m_raw, sizeof(m_raw)) != 0; }
operator UINT8 *() { return m_raw; }
bool from_string(const char *string, int length = -1);
- const char *as_string(std::string &buffer) const;
+ std::string as_string() const;
UINT8 m_raw[20];
static const sha1_t null;
};
@@ -85,7 +85,7 @@ struct md5_t
bool operator!=(const md5_t &rhs) const { return memcmp(m_raw, rhs.m_raw, sizeof(m_raw)) != 0; }
operator UINT8 *() { return m_raw; }
bool from_string(const char *string, int length = -1);
- const char *as_string(std::string &buffer) const;
+ std::string as_string() const;
UINT8 m_raw[16];
static const md5_t null;
};
@@ -136,7 +136,7 @@ struct crc32_t
crc32_t &operator=(const UINT32 crc) { m_raw = crc; return *this; }
operator UINT32() const { return m_raw; }
bool from_string(const char *string, int length = -1);
- const char *as_string(std::string &buffer) const;
+ std::string as_string() const;
UINT32 m_raw;
static const crc32_t null;
};
@@ -182,7 +182,7 @@ struct crc16_t
crc16_t &operator=(const UINT16 crc) { m_raw = crc; return *this; }
operator UINT16() const { return m_raw; }
bool from_string(const char *string, int length = -1);
- const char *as_string(std::string &buffer) const;
+ std::string as_string() const;
UINT16 m_raw;
static const crc16_t null;
};