美文网首页
二十五、hash碰撞

二十五、hash碰撞

作者: 此间有道 | 来源:发表于2020-08-04 13:03 被阅读0次

    一、Hash碰撞后的原则

    当出现冲突时,保留当前仓库已有的对象;

    二、冲突场景

    已存在 新对象 结果
    blob blob commit success, lost fail
    tree blob commit sucess, push fail
    commit blob commit sucess, push fail
    blob commit commit fail, when updating "ref"
    blob tree commit fail, when create commit
    tree commit commit fail, when updating "ref"
    tree tree push success, reference to wrong tree
    commit commit HEAD always point to old
    commit tree commit fail, when create commit

    参考

    1. Linus reply: Starting to think about sha-256?
    2. https://stackoverflow.com/questions/9392365/how-would-git-handle-a-sha-1-collision-on-a-blob/34599081#34599081

    相关文章

      网友评论

          本文标题:二十五、hash碰撞

          本文链接:https://www.haomeiwen.com/subject/ckoirktx.html