爱意满满的作品展示区。
gaoryrt

玩具:短链服务 c-o.cc

  •  
  •   gaoryrt · Oct 10, 2025 · 1571 views
    This topic created in 243 days ago, the information mentioned may be changed or developed.

    本站会员 @ccbikai 做过一款使用 github commit hash 作为数据库的短链服务 ccbikai/hink原理非常简洁美妙:借用 git commit hash 储存键值对,缺点也很明显:没有生成前端、以及明文存储。

    于是搞了个补齐这两点的玩具 gaoryrt/slink,可以访问 c-o.cc 体验。

    How this works?

    生成

    • 前端填入内容和密钥,点击生成
    • 内容和密钥传到 worker ,对称加密后生成 commit content
    • 调用 GitHub API 进行 commit
    • commit 成功得到 commitHash 返回给前端

    访问

    • 访问 /{commitHash}/{key}
    • worker fetch /commit/${commitHash}.patch 获得加密后的 commit content
    • 使用 key 解密后,如果是链接则 redirect ,否则展示内容

    玩具总归是玩具,真要用的话还是推荐原作者的另一个项目 ccbikai/sink,功能全面得多

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2982 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 14:48 · PVG 22:48 · LAX 07:48 · JFK 10:48
    ♥ Do have faith in what you're doing.