SHA1Test.C 500 B

123456789101112131415161718192021222324
  1. /*
  2. * Copyright (C) 2011 Emweb bvba, Kessel-Lo, Belgium.
  3. *
  4. * See the LICENSE file for terms of use.
  5. */
  6. #include <boost/date_time/posix_time/posix_time.hpp>
  7. #include <boost/test/unit_test.hpp>
  8. #include <Wt/Auth/HashFunction>
  9. using namespace Wt;
  10. BOOST_AUTO_TEST_CASE( sha1_test )
  11. {
  12. Auth::SHA1HashFunction f;
  13. std::string msg = "abcdbcdecdefdefgefghfghighij";
  14. std::string salt = "salt";
  15. std::string hash = f.compute(msg, salt);
  16. BOOST_REQUIRE(hash == "6k2mrY3gUBcF62AUhu0TGDshjrM=");
  17. }