src/index.js
function FixEncryptLength(text) {
  var len = text.length;
  var stdLens = [256, 512, 1024, 2048, 4096];
  var stdLen, i, j;
  for (i = 0; i < stdLens.length; i++) {
    stdLen = stdLens[i];
    if (len === stdLen) {
      return text;
    } else if (len < stdLen) {
      var times = stdLen - len;
      var preText = '';
      for (j = 0; j < times; j++) {
        preText += '0';
      }
      return preText + text;
    }
  }
  return text;
}
function FixEncryptLength(text) {
  var len = text.length;
  var stdLens = [256, 512, 1024, 2048, 4096];
  var stdLen, i, j;
  for (i = 0; i < stdLens.length; i++) {
    stdLen = stdLens[i];
    if (len === stdLen) {
      return text;
    } else if (len < stdLen) {
      var times = stdLen - len;
      var preText = '';
      for (j = 0; j < times; j++) {
        preText += '0';
      }
      return preText + text;
    }
  }
  return text;
}
function FixEncryptLength ( text ) { var len = text . length ; var stdLens = [ 256 , 512 , 1024 , 2048 , 4096 ] ; var stdLen , i , j ; for ( i = 0 ; i < stdLens . length ; i ++ ) { stdLen = stdLens [ i ] ; if ( len === stdLen ) { return text ; } else if ( len < stdLen ) { var times = stdLen - len ; var preText = '' ; for ( j = 0 ; j < times ; j ++ ) { preText += '0' ; } return preText + text ; } } return text ; }
If the length of the encrypted text is not enough,add 0 in front
If the length of the encrypted text is not enough add 0 in front