#include "scanpasshash.h"

#include "console.h"
#include "hashcalc.h"

#define        LINEFEED_ASCII_CODE             (0xD)


namespace cryptrav
{

namespace ScanPassHash
{


void           scan(quint8* pHash)
{
 quint8        chr;


 HashCalc* hashCalc = new HashCalc();

 hashCalc -> init();

 do
  {
   chr = Console::getKey();
   hashCalc -> update(&chr, 1); // including linefeed at the end (thus empty password goes)
  } while (chr != LINEFEED_ASCII_CODE);

 hashCalc -> final(pHash);


 delete hashCalc;
}


} // namespace "ScanPassHash"

} // namespace "cryptrav"
