{"_id":"@3-/intbin","_rev":"9-b4a7329d342d62fb5c22d013476c31b3","name":"@3-/intbin","dist-tags":{"latest":"0.1.10"},"versions":{"0.0.5":{"name":"@3-/intbin","version":"0.0.5","author":{"name":"3Ti.Site@gmail.com"},"license":"Apache-2.0","_id":"@3-/intbin@0.0.5","maintainers":[{"name":"3tier","email":"3ti.site@gmail.com"}],"homepage":"https://github.com/3TiSite/node/tree/main/intbin","bugs":{"url":"https://github.com/3TiSite/node/issues"},"dist":{"shasum":"0ea0c072f0a3d589fc70941fec969d7d1fe69e71","tarball":"https://registry.npmjs.org/@3-/intbin/-/intbin-0.0.5.tgz","fileCount":6,"integrity":"sha512-J1uOdhF3fYuwB5nFAC9e7GIJrVT3Azwd3AIuMqrYuTu+az/bXq1yEINvA4X+KsHCIg1EK2NBCcs5Mz1gKX7YOA==","signatures":[{"sig":"MEQCIDtNLxfWGNA/YT+i5MBmmg6MtsFzqEv4ug2GbFHUlcA6AiA6avnvFVFO81Mz5SMGaiPfBSDrOKtvh0dvB4JS9/sSoA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12786},"main":"_.js","types":"./_.d.ts","exports":{".":"./_.js","./*":"./*"},"gitHead":"8807c53c2a2627a819aba47fec5929af862017fe","_npmUser":{"name":"3tier","email":"3ti.site@gmail.com"},"repository":{"url":"git+https://github.com/3TiSite/node.git","type":"git"},"_npmVersion":"10.2.0","description":"和 @3-/binmap 的区别是值可以是任意 js 对象，但是不可以 dump 和 load","directories":{},"_nodeVersion":"21.0.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/intbin_0.0.5_1700096923241_0.5390767993891092","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"@3-/intbin","version":"0.1.1","author":{"name":"3Ti.Site@gmail.com"},"license":"Apache-2.0","_id":"@3-/intbin@0.1.1","maintainers":[{"name":"3tier","email":"3ti.site@gmail.com"}],"homepage":"https://github.com/3TiSite/node/tree/main/intbin","bugs":{"url":"https://github.com/3TiSite/node/issues"},"dist":{"shasum":"ce6f4ccb314537f2402da2a6cf323913c3596190","tarball":"https://registry.npmjs.org/@3-/intbin/-/intbin-0.1.1.tgz","fileCount":6,"integrity":"sha512-dYL6syNZMYOOZV4yfLp6/cXPOyHVU3dRWqi5LO0hqh04WknomzOR78WDUqKE9x6pDZgHUCwcbXNe6zRc9SfnJA==","signatures":[{"sig":"MEYCIQCtD9tDuJCVAN+jFiS1aFGkCbf+/cpTB1kcdmE7Sn7aYQIhAJRxyRin8rfpib82jW4539hVfD0hxh+YGRN6kHmYnTLA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12986},"main":"_.js","type":"module","types":"./_.d.ts","exports":{".":"./_.js","./*":"./*"},"gitHead":"a09905320563b6a20e762da4c2ecbf6be22013da","_npmUser":{"name":"3tier","email":"3ti.site@gmail.com"},"repository":{"url":"git+https://github.com/3TiSite/node.git","type":"git"},"_npmVersion":"10.2.0","description":"和 @3-/binmap 的区别是值可以是任意 js 对象，但是不可以 dump 和 load","directories":{},"_nodeVersion":"21.0.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/intbin_0.1.1_1702291934784_0.35907611893935854","host":"s3://npm-registry-packages"}},"0.1.2":{"name":"@3-/intbin","version":"0.1.2","author":{"name":"3Ti.Site@gmail.com"},"license":"Apache-2.0","_id":"@3-/intbin@0.1.2","maintainers":[{"name":"3tier","email":"3ti.site@gmail.com"}],"homepage":"https://github.com/3TiSite/node/tree/main/intbin","bugs":{"url":"https://github.com/3TiSite/node/issues"},"dist":{"shasum":"d72b05556fa63d145590e6664a8de864bec7b4b5","tarball":"https://registry.npmjs.org/@3-/intbin/-/intbin-0.1.2.tgz","fileCount":6,"integrity":"sha512-c3VC9WxDtL4HnV8GyqUUUWwSxqbHbW8FXQqOZF5PD5gNynv6YshAk5PP1GY9uKR+vpGtKxeS8uzABp/GhrvYdQ==","signatures":[{"sig":"MEUCIBCKrCr3ou5uj9PfPseJVKYnZEloT6l6O0pg8xTmxPUeAiEAkKcmyEgixfiNsnVEJD3l3DFjVUiy73MDmfWdq+rjyB8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12986},"main":"_.js","type":"module","types":"./_.d.ts","exports":{".":"./_.js","./*":"./*"},"gitHead":"1407aa60ff728cd990553d210e96c853d4af94df","_npmUser":{"name":"3tier","email":"3ti.site@gmail.com"},"repository":{"url":"git+https://github.com/3TiSite/node.git","type":"git"},"_npmVersion":"10.2.0","description":"和 @3-/binmap 的区别是值可以是任意 js 对象，但是不可以 dump 和 load","directories":{},"_nodeVersion":"21.0.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/intbin_0.1.2_1702292083779_0.7884891587857024","host":"s3://npm-registry-packages"}},"0.1.5":{"name":"@3-/intbin","version":"0.1.5","author":{"name":"i18n.site@gmail.com"},"license":"Apache-2.0","_id":"@3-/intbin@0.1.5","maintainers":[{"name":"i18n-now","email":"i18n.site@gmail.com"}],"homepage":"https://atomgit.com/i18n/lib/tree/dev/intbin","dist":{"shasum":"28e3dc35e40d7c49de0df266ca1713d9bf7388f5","tarball":"https://registry.npmjs.org/@3-/intbin/-/intbin-0.1.5.tgz","fileCount":6,"integrity":"sha512-oVgI61ZKvKE/YHBaXJWDSkbHhyiBtfJ2y1fvB2dZWD/ulI8HEqwza51KCpbLVTQpISFCK1ELEFX0lA/EyGRrRg==","signatures":[{"sig":"MEUCIQCLaiKJm578pStH/1i+UeBYzuAjyXSurL19ynNxsmyJZwIgVqgFIb6kKu8JSo5Z8d1jwA0FCkbfoeCmbQvbm/7W25A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2486},"type":"module","_from":"file:3--intbin-0.1.5.tgz","exports":{".":"./lib.js","./*":"./*"},"scripts":{},"_npmUser":{"name":"i18n-now","email":"i18n.site@gmail.com"},"_resolved":"/private/var/folders/4x/n5x1dwrj39v_hl53vyprqcn80000gn/T/e2bb1a18e1c385ce17c15721ab305aee/3--intbin-0.1.5.tgz","_integrity":"sha512-oVgI61ZKvKE/YHBaXJWDSkbHhyiBtfJ2y1fvB2dZWD/ulI8HEqwza51KCpbLVTQpISFCK1ELEFX0lA/EyGRrRg==","repository":{"url":"git+https://atomgit.com/i18n/lib.git","type":"git"},"_npmVersion":"10.9.0","description":"[test/main.coffee](./test/main.coffee) :","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/intbin_0.1.5_1735876029535_0.8625468781348951","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@3-/intbin","version":"0.1.6","keywords":["integer","binary","base64url","base255"],"author":{"name":"i18n.site@gmail.com"},"license":"MulanPSL-2.0","_id":"@3-/intbin@0.1.6","maintainers":[{"name":"i18n-now","email":"i18n.site@gmail.com"}],"homepage":"https://github.com/i18n-site/lib/tree/dev/intbin","bugs":{"url":"https://github.com/i18n-site/lib/issues"},"dist":{"shasum":"275b60244c40a332d62a59afb137d086cfb12878","tarball":"https://registry.npmjs.org/@3-/intbin/-/intbin-0.1.6.tgz","fileCount":8,"integrity":"sha512-1y0g7eNWDg3+iNurzVVoMzFRYTKFAqewH35Xh9kkRRLjEnHjhUcP617orf0PdZuR+Mps8kcrxoL9xxe9GhYLhQ==","signatures":[{"sig":"MEUCIQCg/F5QM6HB7YTt3EHyzbeNaLJSc6bYRa6c7Fi7Qnjh+gIgIZmTraS0iqyV/QProL5O+Wnd7/tCCVdj4GAlx3KK4qU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12763},"type":"module","exports":{".":"./lib.js","./*":"./*"},"gitHead":"6f3c8b3ae38fd2a9390c44e237897accaf6b3927","scripts":{},"_npmUser":{"name":"i18n-now","email":"i18n.site@gmail.com"},"repository":{"url":"git+https://github.com/i18n-site/lib.git","type":"git"},"_npmVersion":"11.13.0","description":"Efficient conversion between integers, binaries, URL-safe base64 and base255 / 整数与二进制、URL安全base64及base255的高效转换工具","directories":{},"_nodeVersion":"26.2.0","_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/intbin_0.1.6_1779869927430_0.971421381160329","host":"s3://npm-registry-packages-npm-production"}},"0.1.7":{"name":"@3-/intbin","version":"0.1.7","keywords":["integer","binary","base64url","base255"],"author":{"name":"i18n.site@gmail.com"},"license":"MulanPSL-2.0","_id":"@3-/intbin@0.1.7","maintainers":[{"name":"i18n-now","email":"i18n.site@gmail.com"}],"homepage":"https://github.com/i18n-site/lib/tree/dev/intbin","bugs":{"url":"https://github.com/i18n-site/lib/issues"},"dist":{"shasum":"5bb996f6f29b854082bbbbe89411ccbe14617c1e","tarball":"https://registry.npmjs.org/@3-/intbin/-/intbin-0.1.7.tgz","fileCount":8,"integrity":"sha512-XEc1VHQYnWauL0rIMQHGR5DjpJSMUHaV2XMAhRPNWKwpo0Tl930nSBzEQCThF9UpnxZ7RacoBEnWTFGfP90xLA==","signatures":[{"sig":"MEUCIDyl/Thb42hvCzFxHss59455zQULvWRKnniQ/vZ78/N2AiEAzd6jobOIhzKkgIPaNMV0kJqasljqMT/aAjyg2MWUEZc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12682},"type":"module","exports":{".":"./lib.js","./*":"./*"},"gitHead":"a17592e326b61190231888b73e7eaef43b6cbb84","scripts":{},"_npmUser":{"name":"i18n-now","email":"i18n.site@gmail.com"},"repository":{"url":"git+https://github.com/i18n-site/lib.git","type":"git"},"_npmVersion":"11.13.0","description":"Efficient conversion between integers, binaries, URL-safe base64 and base255 / 整数与二进制、URL安全base64及base255的高效转换工具","directories":{},"_nodeVersion":"26.2.0","dependencies":{"@3-/base64url":"^0.1.4"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/intbin_0.1.7_1779870613717_0.8371102585793784","host":"s3://npm-registry-packages-npm-production"}},"0.1.10":{"name":"@3-/intbin","version":"0.1.10","description":"Efficient conversion between integers, binaries, URL-safe base64 and base255 / 整数与二进制、URL安全base64及base255的高效转换工具","keywords":["integer","binary","base64url","base255"],"repository":{"type":"git","url":"git+https://github.com/i18n-site/lib.git"},"homepage":"https://github.com/i18n-site/lib/tree/dev/intbin","author":{"name":"i18n.site@gmail.com"},"license":"MulanPSL-2.0","exports":{".":"./lib.js","./*":"./*"},"devDependencies":{},"scripts":{},"type":"module","dependencies":{"@3-/base64url":"^0.1.4"},"gitHead":"1262ee2510dd2fff1bba4f1adef7c0183d69c6c3","_id":"@3-/intbin@0.1.10","bugs":{"url":"https://github.com/i18n-site/lib/issues"},"_nodeVersion":"26.2.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-pl8zhTcu6blLJikZyZ+J9BDz5BqsI8p+X1w7/9aTOxqkY/Cbf+LfaDVCMPVFdfji6E427GGAsRCI46zYeKHY1Q==","shasum":"058cf21819e75d33b63e876ec82972ff5a9eab2d","tarball":"https://registry.npmjs.org/@3-/intbin/-/intbin-0.1.10.tgz","fileCount":10,"unpackedSize":12828,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCiSzuckFxqTZgESB0bCsWhhp+f3ipFYkdwuCTzJrHcPgIhAOez+aJxp2kuFcxOB3XU7YHbYMSonBUdSGB/GS3LI/ZJ"}]},"_npmUser":{"name":"i18n-now","email":"i18n.site@gmail.com"},"directories":{},"maintainers":[{"name":"i18n-now","email":"i18n.site@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/intbin_0.1.10_1780037687639_0.10727337591306974"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-16T01:08:43.161Z","modified":"2026-05-29T06:54:47.913Z","0.0.5":"2023-11-16T01:08:43.454Z","0.1.1":"2023-12-11T10:52:14.979Z","0.1.2":"2023-12-11T10:54:44.023Z","0.1.5":"2025-01-03T03:47:09.716Z","0.1.6":"2026-05-27T08:18:47.588Z","0.1.7":"2026-05-27T08:30:13.870Z","0.1.10":"2026-05-29T06:54:47.781Z"},"bugs":{"url":"https://github.com/i18n-site/lib/issues"},"author":{"name":"i18n.site@gmail.com"},"license":"MulanPSL-2.0","homepage":"https://github.com/i18n-site/lib/tree/dev/intbin","keywords":["integer","binary","base64url","base255"],"repository":{"type":"git","url":"git+https://github.com/i18n-site/lib.git"},"description":"Efficient conversion between integers, binaries, URL-safe base64 and base255 / 整数与二进制、URL安全base64及base255的高效转换工具","maintainers":[{"name":"i18n-now","email":"i18n.site@gmail.com"}],"readme":"[English](#en) | [中文](#zh)\n\n---\n\n<a id=\"en\"></a>\n# @3-/intbin : Efficient Conversion Between Integers, Binaries, and URL-Safe Base64/Base255 Encoded Strings\n\n## Table of Contents\n- [Features](#features)\n- [Demonstration](#demonstration)\n- [Design & Call Flow](#design--call-flow)\n- [Technology Stack](#technology-stack)\n- [Directory Structure](#directory-structure)\n- [History & Technical Anecdote](#history--technical-anecdote)\n\n## Features\nThis library facilitates high-performance conversion between safe integers (up to 53-bit precision), binaries (`Uint8Array`), URL-safe Base64 strings, and Base255 strings.\nCore features include:\n- Conversion between integers and compact binary byte streams, with automatic trimming of high-order zero bytes to minimize storage footprint.\n- Conversion between integers and URL-safe Base64 (unpadded) strings.\n- Conversion between integers and Base255 strings.\n- Base255 guarantees that the generated string never contains the colon character (`:`), making it suitable for composite keys delimited by colons.\n- Pure browser-compatible API implementation (utilizing `Uint8Array`, `atob`, and `btoa`), removing Node.js `Buffer` dependency for seamless execution across browsers, Node.js, and Bun.\n\n## Demonstration\nRefer to [test/main.js](file:///Users/z/i18n/lib/intbin/test/main.js) for execution examples:\n\n```javascript\nimport binU64 from \"@3-/intbin/binU64.js\";\nimport u64Bin from \"@3-/intbin/u64Bin.js\";\nimport u64B64 from \"@3-/intbin/u64B64.js\";\nimport b64U64 from \"@3-/intbin/b64U64.js\";\nimport u64B255 from \"@3-/intbin/u64B255.js\";\nimport b255U64 from \"@3-/intbin/b255U64.js\";\n\n// 1. Integer to Binary\nconst bin = u64Bin(51230); // returns Uint8Array\nconst num = binU64(bin); // returns 51230\n\n// 2. Integer to Base64URL\nconst b64 = u64B64(51230); // returns \"Hsg\"\nconst numB64 = b64U64(b64); // returns 51230\n\n// 3. Integer to Base255\nconst b255 = u64B255(51230); // returns Base255 encoded string\nconst numB255 = b255U64(b255); // returns 51230\n```\n\n## Design & Call Flow\nIntegers are translated to binaries first, and then translated to target text encodings.\nThe calling relationship and flow is illustrated below:\n\n```mermaid\ngraph TD\n    subgraph Encoding [Encoding Workflow]\n        n[Integer n] --> u64Bin[u64Bin]\n        u64Bin -->|Uint8Array| u64B64[u64B64 / Base64URL Conversion]\n        u64B64 --> b64_out[Base64URL String]\n        \n        n --> u64B255[u64B255 / Base255 Encoding]\n        u64B255 --> b255_out[Base255 String]\n        u64B255 -.->|Internal Call| u64Bin\n    end\n\n    subgraph Decoding [Decoding Workflow]\n        b64_in[Base64URL String] --> b64U64[b64U64 / Base64URL Decoding]\n        b64U64 -->|Uint8Array| binU64_1[binU64]\n        binU64_1 --> n_out1[Integer n]\n\n        b255_in[Base255 String] --> b255U64[b255U64 / Base255 Decoding]\n        b255U64 --> n_out2[Integer n]\n    end\n```\n\nIn the Base255 encoding process, bytes are treated as radix-255 digits. To prevent the occurrence of colon characters (`:`, ASCII 58), any digit value equal to or greater than 58 is incremented by 1 during encoding and decremented by 1 during decoding.\n\n## Technology Stack\n- **Runtimes**: Bun, Node.js (v16+), modern web browsers\n- **Standard**: ES6+ (JavaScript modules ESM)\n- **APIs**: `Uint8Array`, `btoa`, `atob`\n\n## Directory Structure\n```\n.\n├── src/            # Source code directory\n│   ├── b255U64.js  # Base255 string to integer conversion\n│   ├── b64U64.js   # Base64URL string to integer conversion\n│   ├── binU64.js   # Binary to integer conversion\n│   ├── u64B255.js  # Integer to Base255 string conversion\n│   ├── u64B64.js   # Integer to Base64URL string conversion\n│   └── u64Bin.js   # Integer to binary conversion\n├── test/           # Test scripts directory\n│   └── main.js     # Bun-executable test suite\n├── run.sh          # Build and test execution script\n└── package.json    # Project metadata configuration\n```\n\n## History & Technical Anecdote\nThe history of Base64 dates back to early email communication systems. Under the SMTP protocol, mail systems could only transmit 7-bit ASCII characters reliably. Non-textual binaries such as images or attachments frequently ended up corrupted when transmitted directly. To ensure transmission integrity, RFCs defined Base64 encoding to map groups of 3 binary bytes into 4 character symbols chosen from a safe character set (A-Z, a-z, 0-9, +, /).\n\nBase255 represents a specialized variation of this encoding strategy. In distributed databases or key-value storage designs, composite keys are often constructed by joining multiple identifiers using a colon (`:`) separator. Standard encodings containing colons break field parsers. By omitting colon characters entirely (ASCII 58), Base255 provides a collision-free, high-density key serialization scheme without requiring character escaping.\n\n---\n\n<a id=\"zh\"></a>\n# @3-/intbin : 整数与二进制及 URL 安全 Base64/Base255 编码的高效转换工具\n\n## 目录\n- [功能介绍](#功能介绍)\n- [演示说明](#演示说明)\n- [设计思路与流程](#设计思路与流程)\n- [技术堆栈](#技术堆栈)\n- [目录结构](#目录结构)\n- [技术与历史小故事](#技术与历史小故事)\n\n## 功能介绍\n本库主要提供整数（安全整数范围内，最大支持 53 位）与二进制数据（Uint8Array）、URL 安全 Base64 编码以及 Base255 编码之间的互转。\n主要包含以下核心功能：\n- 整数与紧凑二进制字节流的互转，自动截断高位零字节以节省存储空间。\n- 整数与 URL 安全 Base64（无填充）编码字符串的互转。\n- 整数与 Base255 编码字符串的互转。\n- Base255 编码保证生成的字符串不含冒号（`:`），适合用于以冒号作为分隔符的多字段组合键。\n- 采用原生浏览器兼容的 API（如 `Uint8Array`、`atob`、`btoa`），摆脱了对 Node.js `Buffer` 的依赖，在浏览器环境和 Node.js/Bun 环境下均可直接运行。\n\n## 演示说明\n详细的使用演示可参考 [test/main.js](file:///Users/z/i18n/lib/intbin/test/main.js)：\n\n```javascript\nimport binU64 from \"@3-/intbin/binU64.js\";\nimport u64Bin from \"@3-/intbin/u64Bin.js\";\nimport u64B64 from \"@3-/intbin/u64B64.js\";\nimport b64U64 from \"@3-/intbin/b64U64.js\";\nimport u64B255 from \"@3-/intbin/u64B255.js\";\nimport b255U64 from \"@3-/intbin/b255U64.js\";\n\n// 1. 整数与二进制转换\nconst bin = u64Bin(51230); // 返回 Uint8Array\nconst num = binU64(bin); // 返回 51230\n\n// 2. 整数与 Base64URL 转换\nconst b64 = u64B64(51230); // 返回 \"Hsg\"\nconst numB64 = b64U64(b64); // 返回 51230\n\n// 3. 整数与 Base255 转换\nconst b255 = u64B255(51230); // 返回 Base255 编码字符串\nconst numB255 = b255U64(b255); // 返回 51230\n```\n\n## 设计思路与流程\n本项目通过将整数转换为二进制表示，再对二进制进行特定的文本编码。\n整个转换逻辑流程图如下：\n\n```mermaid\ngraph TD\n    subgraph Encoding [编码流程]\n        n[整数 n] --> u64Bin[u64Bin]\n        u64Bin -->|Uint8Array| u64B64[u64B64 / Base64URL 转换]\n        u64B64 --> b64_out[Base64URL 字符串]\n        \n        n --> u64B255[u64B255 / Base255 编码]\n        u64B255 --> b255_out[Base255 字符串]\n        u64B255 -.->|内部调用| u64Bin\n    end\n\n    subgraph Decoding [解码流程]\n        b64_in[Base64URL 字符串] --> b64U64[b64U64 / Base64URL 解码]\n        b64U64 -->|Uint8Array| binU64_1[binU64]\n        binU64_1 --> n_out1[整数 n]\n\n        b255_in[Base255 字符串] --> b255U64[b255U64 / Base255 解码]\n        b255U64 --> n_out2[整数 n]\n    end\n```\n\n在 Base255 编码中，数据被视作 255 进制数进行转换。为了防止输出文本中包含冒号（`:`），对于所有数值大于等于 58（冒号的 ASCII 码）的数位，均自动加 1。解码时则逆向减 1，还原为原始字节。\n\n## 技术堆栈\n- **运行环境**: Bun, Node.js (v16+), 现代浏览器\n- **语言标准**: ES6+ (JavaScript 模块化 ESM)\n- **底层 API**: `Uint8Array`, `btoa`, `atob`\n\n## 目录结构\n```\n.\n├── src/            # 源代码目录\n│   ├── b255U64.js  # Base255 字符串转整数\n│   ├── b64U64.js   # Base64URL 字符串转整数\n│   ├── binU64.js   # 二进制转整数\n│   ├── u64B255.js  # 整数转 Base255 字符串\n│   ├── u64B64.js   # 整数转 Base64URL 字符串\n│   └── u64Bin.js   # 整数转二进制\n├── test/           # 测试代码目录\n│   └── main.js     # 基于 Bun 的测试脚本\n├── run.sh          # 构建与测试执行脚本\n└── package.json    # 项目配置信息\n```\n\n## 技术与历史小故事\nBase64 编码起源于早期网络通信。在 SMTP 协议设计之初，电子邮件系统仅能可靠地传输 7 位 ASCII 字符，二进制文件（如图片或附件）在传输过程中经常因控制字符被截断而损坏。为了解决信息完整性问题，RFC 定义了 Base64 编码，将 3 字节的二进制数据合并转换为 4 个由安全字符集（A-Z, a-z, 0-9, +, /）组成的字符。\n\nBase255 则是这种设计的衍生变体。在现代分布式系统和高性能数据库设计中，通常需要将多个实体 ID 或时间戳拼接为单一复合主键。复合主键常用冒号（`:`）作为字段分隔符。如果在主键各个部分的编码中包含了冒号，解析时就会产生歧义。Base255 编码排除 ASCII 字符集中的冒号（第 58 号字符），提供了字符无冲突、高密度存储、无需转义的组合键生成方案。\n\n---\n\n## About\n\nThis project is an open-source component of [i18n.site ⋅ Internationalization Solution](https://i18n.site).\n\n* [i18 : MarkDown Command Line Translation Tool](https://i18n.site/i18)\n\n  The translation perfectly maintains the Markdown format.\n\n  It recognizes file changes and only translates the modified files.\n\n  The translated Markdown content is editable; if you modify the original text and translate it again, manually edited translations will not be overwritten (as long as the original text has not been changed).\n\n* [i18n.site : MarkDown Multi-language Static Site Generator](https://i18n.site/i18n.site)\n\n  Optimized for a better reading experience\n\n## 关于\n\n本项目为 [i18n.site ⋅ 国际化解决方案](https://i18n.site) 的开源组件。\n\n* [i18 :  MarkDown命令行翻译工具](https://i18n.site/i18)\n\n  翻译能够完美保持 Markdown 的格式。能识别文件的修改，仅翻译有变动的文件。\n\n  Markdown 翻译内容可编辑；如果你修改原文并再次机器翻译，手动修改过的翻译不会被覆盖（如果这段原文没有被修改）。\n\n* [i18n.site : MarkDown多语言静态站点生成器](https://i18n.site/i18n.site) 为阅读体验而优化。\n","readmeFilename":"README.md"}