]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_hash.h
Get rid of a bunch of memory-wasting C-style strings
[user/henk/code/inspircd.git] / src / modules / m_hash.h
index 5dd528e6ee60b29e205861881d201e3967bb278a..88dcb5b6d5fa93872b1288044b0dd4746ea30871 100644 (file)
@@ -2,12 +2,9 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- *                       E-mail:
- *                <brain@chatspike.net>
- *                <Craig@chatspike.net>
- *     
- * Written by Craig Edwards, Craig McLure, and others.
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
+ *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
  *
@@ -57,9 +54,9 @@ class HashRequest : public Request
        }
 
        /** Get data to be hashed */
-       const char* GetHashData()
+       std::string& GetHashData()
        {
-               return tohash.c_str();
+               return tohash;
        }
 
        /** Get keys (IVs) to be used */
@@ -92,7 +89,7 @@ class HashNameRequest : public HashRequest
        HashNameRequest(Module* Me, Module* Target) : HashRequest("NAME", Me, Target)
        {
        }
-}
+};
 
 /** Send this class to the hashing module to reset the Hash module to a known state.
  * This will reset the IV to the defaults specified by the Hash spec,
@@ -138,7 +135,7 @@ class HashSumRequest : public HashRequest
         * @param Target A pointer to the hashing module
         * @param data The data to be hashed
         */
-       HashSumRequest(Module* Me, Module* Target, const std::string &data) : HashRequest(Me, Target, data)
+       HashSumRequest(Module* Me, Module* Target, const std::string &sdata) : HashRequest(Me, Target, sdata)
        {
        }
 };
@@ -164,7 +161,7 @@ class HashKeyRequest : public HashRequest
         * @param data The new IV's. This should be an array of exactly four 32 bit values.
         * On 64-bit architectures, the upper 32 bits of the values will be discarded.
         */
-       HashKeyRequest(Module* Me, Module* Target, unsigned int* data) : HashRequest(Me, Target, data)
+       HashKeyRequest(Module* Me, Module* Target, unsigned int* sdata) : HashRequest(Me, Target, sdata)
        {
        }
 };
@@ -190,7 +187,7 @@ class HashHexRequest : public HashRequest
         * @param data The hex sequence to use. This should contain exactly 16 ASCII characters,
         * terminated by a NULL char.
         */
-       HashHexRequest(Module* Me, Module* Target, const char* data) : HashRequest(Me, Target, data)
+       HashHexRequest(Module* Me, Module* Target, const char* sdata) : HashRequest(Me, Target, sdata)
        {
        }
 };