```\nfunction log10(uint256 value) internal pure returns (uint256) {\n    uint256 result = 0;\n    unchecked {\n        if (value >= 10 ** 64) {\n            value /= 10 ** 64;\n            result += 64;\n        }\n        if (value >= 10 ** 32) {\n            value /= 10 ** 32;\n            result += 32;\n        }\n        if (value >= 10 ** 16) {\n            value /= 10 ** 16;\n            result += 16;\n        }\n        if (value >= 10 ** 8) {\n            value /= 10 ** 8;\n            result += 8;\n        }\n        if (value >= 10 ** 4) {\n            value /= 10 ** 4;\n            result += 4;\n        }\n        if (value >= 10 ** 2) {\n            value /= 10 ** 2;\n            result += 2;\n        }\n        if (value >= 10 ** 1) {\n            result += 1;\n        }\n    }\n    return result;\n}\n```\n