```\nfunction byteLength(ShortString sstr) internal pure returns (uint256) {\n    uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\n    if (result > 31) {\n        revert InvalidShortString();\n    }\n    return result;\n}\n```\n