added sha1_gen() func