make message digest threadsafe