Detect CommonJS environment in sha1.js