generic script to index documents
added exception handling
sha1.toupper