a javascript implement of sha1 hash