added window.sha1 (because js implementation is a performance bottleneck)