diff options
| author | Remko Tronçon <git@el-tramo.be> | 2009-11-27 19:06:47 (GMT) |
|---|---|---|
| committer | Remko Tronçon <git@el-tramo.be> | 2009-11-27 19:06:47 (GMT) |
| commit | aa09a889108c4d0e3c5888ad98958d8f3e12bd3b (patch) | |
| tree | 3c621ae0a6e2150281be182b37e2837b804adcba /Swiften/Disco/CapsInfoGenerator.cpp | |
| parent | c89ef0ffae597ac8c1063732e1d9a2d84703a80c (diff) | |
| download | swift-aa09a889108c4d0e3c5888ad98958d8f3e12bd3b.zip swift-aa09a889108c4d0e3c5888ad98958d8f3e12bd3b.tar.bz2 | |
Added MD5 hashing algorithm.
Moved 'hexifying' of hashes into its own class, such that it can be
shared between all hashes.
Diffstat (limited to 'Swiften/Disco/CapsInfoGenerator.cpp')
| -rw-r--r-- | Swiften/Disco/CapsInfoGenerator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Swiften/Disco/CapsInfoGenerator.cpp b/Swiften/Disco/CapsInfoGenerator.cpp index 339d76e..8d9e407 100644 --- a/Swiften/Disco/CapsInfoGenerator.cpp +++ b/Swiften/Disco/CapsInfoGenerator.cpp @@ -1,34 +1,34 @@ #include "Swiften/Disco/CapsInfoGenerator.h" #include <algorithm> #include "Swiften/Base/foreach.h" #include "Swiften/Elements/DiscoInfo.h" #include "Swiften/StringCodecs/SHA1.h" #include "Swiften/StringCodecs/Base64.h" namespace Swift { CapsInfoGenerator::CapsInfoGenerator(const String& node) : node_(node) { } CapsInfo CapsInfoGenerator::generateCapsInfo(const DiscoInfo& discoInfo) const { String serializedCaps; std::vector<DiscoInfo::Identity> identities(discoInfo.getIdentities()); std::sort(identities.begin(), identities.end()); foreach (const DiscoInfo::Identity& identity, identities) { serializedCaps += identity.getCategory() + "/" + identity.getType() + "/" + identity.getLanguage() + "/" + identity.getName() + "<"; } std::vector<String> features(discoInfo.getFeatures()); std::sort(features.begin(), features.end()); foreach (const String& feature, features) { serializedCaps += feature + "<"; } - String version(Base64::encode(SHA1::getBinaryHash(serializedCaps))); + String version(Base64::encode(SHA1::getHash(serializedCaps))); return CapsInfo(node_, version, "sha-1"); } } |
Swift