diff --git a/etc/codeTemplates/codeStream/fixedValueFvPatchScalarFieldTemplate.C b/etc/codeTemplates/codeStream/fixedValueFvPatchScalarFieldTemplate.C index 937fb5b550..417b77ee68 100644 --- a/etc/codeTemplates/codeStream/fixedValueFvPatchScalarFieldTemplate.C +++ b/etc/codeTemplates/codeStream/fixedValueFvPatchScalarFieldTemplate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 20101-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.C b/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.C index 2d2e51bf73..16dbd838cd 100644 --- a/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.C +++ b/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.C @@ -101,6 +101,22 @@ bool Foam::SHA1Digest::empty() const } +std::string Foam::SHA1Digest::str() const +{ + std::string buf; + buf.resize(length*2); + + unsigned nChar = 0; + for (unsigned i = 0; i < length; ++i) + { + buf[nChar++] = hexChars[((v_[i] >> 4) & 0xF)]; + buf[nChar++] = hexChars[(v_[i] & 0xF)]; + } + + return buf; +} + + // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * // bool Foam::SHA1Digest::operator==(const SHA1Digest& rhs) const diff --git a/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.H b/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.H index 19c9698d13..dca6adc367 100644 --- a/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.H +++ b/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.H @@ -80,6 +80,9 @@ public: //- Return true if the digest is empty (ie, all zero). bool empty() const; + //- Return string representation + std::string str() const; + //- Equality operator bool operator==(const SHA1Digest&) const;