JavaScript functions for abstracting SHA1 implementations