Buffer.byteLength
Buffer.byteLength(字符串,编码方式)计算指定字符串的字节数
根据不同的编码方法,统计字符串的字节数
const string ='您好,世界!';string.length;// 6Buffer.byteLength(string,'utf8');// 18Buffer.byteLength(string,'utf16le');// 12Buffer.byteLength(string,'base64');// 4Buffer.byteLength(string,'hex');// 3
