JavaScript:实现加密哈希SHA-1 算法
// main variablesconst CHAR_SIZE = 8/*** Adds padding to binary/hex string representation** @param {string} str - string representation (binary/hex)* @param {int} bits - total number of bits wanted* @return {string} - string representation padding with empty (0) bits** @example*pad("10011", 8); // "00010011"*/function pad (str, bits) {