I found this c++ implementation of SHA1 on this page zedwood.com. Why doesn't the this function work. It says that max has to be a constant. How to get around this problem?
void SHA1::read(std::istream &is, std::string &s, int max)
{
char sbuf[max];
is.read(sbuf, max);
s.assign(sbuf, is.gcount());
}``