code: function des_addPadding(message, padding) {
    const padLength = 8 - (message.length % 8);
  
    let pad;
    if (padding === 2 && (padLength < 8)) { //pad the message with spaces
      pad = " ".charCodeAt(0);
    } else if (padding === 1) { //PKCS7 padding
      pad = padLength;
    } else if (!padding && (padLength < 8)) { //pad the message out with null bytes
      pad = 0;
    } else if (padLength === 8) {
      return message;
    } else {
      throw new Error('des: invalid padding');
    }
  
    const paddedMessage = new Uint8Array(message.length + padLength);
    for (let i = 0; i < message.length; i++) {
      paddedMessage[i] = message[i];
    }
    for (let j = 0; j < padLength; j++) {
      paddedMessage[message.length + j] = pad;
    }
  
    return paddedMessage;
  }
docs: end of des_createKeys