1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
30 \*---------------------------------------------------------------------------*/
32 #include "OSHA1stream.H"
33 #include "IStringStream.H"
34 #include "dictionary.H"
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 int main(int argc, char * argv[])
45 std::string str("The quick brown fox jumps over the lazy dog");
47 Info<< SHA1("The quick brown fox jumps over the lazy dog") << nl;
49 sha.append("The quick brown fox jumps over the lazy dog");
53 sha.append("The quick brown fox jumps over the lazy dog");
62 Info<<"SHA1 digests are identical\n";
66 Info<<"SHA1 digests are different\n";
68 Info<<"lhs:" << sha << " rhs:" << shaDig << endl;
74 SHA1Digest shaDig_A = sha;
80 Info<< "digest1: " << sha_A << nl;
81 Info<< "digest2: " << sha << nl;
89 Info<< "digest3: " << sha << nl;
91 // try the output buffer interface
96 Info<< os.digest() << endl;
99 Info<< os.digest() << endl;
102 os << "The quick brown fox jumps over the lazy dog";
103 Info<< os.digest() << endl;
112 "parent { Default_Boundary_Region { type zeroGradient; } }"
113 "inlet_1 { value inlet_1; }"
114 "inlet_2 { value inlet_2; }"
115 "inlet_3 { value inlet_3; }"
116 "\"inlet_.*\" { value XXX; }"
120 Info<< "dict:" << endl;
121 dict.write(Info, false);
123 dictionary dict2(dict);
126 dict.write(os, false);
127 Info<< os.digest() << endl;
129 Info<< dict2.digest() << endl;