"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hashCode = exports.isNotEmpty = exports.isEmpty = exports.isBlank = exports.isNotBlank = void 0;
/**
 * 字符串是否不为空不为空字符串
 * @param s 字符串
 */
function isNotBlank(s) {
    return !isBlank(s);
}
exports.isNotBlank = isNotBlank;
/**
 * 字符串是否为空为空字符串
 * @param s  字符串
 */
function isBlank(s) {
    return s == null ? true : s.trim() === '';
}
exports.isBlank = isBlank;
/**
 * 是否空字符串
 * @param cs
 */
function isEmpty(cs) {
    return cs == null || cs.length == 0;
}
exports.isEmpty = isEmpty;
/**
 * 是否不是空字符串
 * @param cs
 */
function isNotEmpty(cs) {
    return !isEmpty(cs);
}
exports.isNotEmpty = isNotEmpty;
/**
 * 计算字符串hash
 * @param str 字符串
 */
function hashCode(str) {
    return str.split('').reduce((a, b) => {
        a = (a << 5) - a + b.charCodeAt(0);
        return a & a;
    }, 0);
}
exports.hashCode = hashCode;
//# sourceMappingURL=StringUtils.js.map