/**
 * getByteLen.js
 *
 * @Author: apple
 * @Date: 2018/4/3 01:10
 */

var getByteLen = function getByteLen(str) {
    if (str === null) return 0;
    if (typeof str !== 'string') {
        str += '';
    }
    return Math.floor(str.replace(/[^\x00-\xff]/g, '01').length / 2);
};

export default getByteLen;