code: function (str) {
                  var bytes = [];
                  var length = str ? (str.length < 256 ? str.length : 255) : 0;
                  bytes.push(length);
  
                  for (var i = 0, l = str.length; i < l; i++) {
                      var c = str.charCodeAt(i);
                      // non-ASCII characters are substituted with '*'
                      bytes.push(c < 128 ? c : 42);
                  }
  
                  return bytes;
              }
docs: 获取pascal string 字节数组
  
  @param {string} str 字符串
  @return {Array.<byte>} byteArray byte数组