Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Paste
P378
(An Untitled Masterwork)
Active
Public
Actions
Authored by
vlorentz
on Apr 2 2019, 4:14 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
def
test_content_add_collision_sha256
(
self
):
cont1
=
self
.
cont
# create (corrupted) content with same sha256 but != sha1{,_git}
cont1b
=
cont1
.
copy
()
sha1_array
=
bytearray
(
cont1b
[
'sha1'
])
sha1_array
[
0
]
+=
1
cont1b
[
'sha1'
]
=
bytes
(
sha1_array
)
sha1git_array
=
bytearray
(
cont1b
[
'sha1_git'
])
sha1git_array
[
0
]
+=
1
cont1b
[
'sha1_git'
]
=
bytes
(
sha1git_array
)
self
.
storage
.
content_add
([
cont1
,
cont1b
])
Event Timeline
vlorentz
created this paste.
Apr 2 2019, 4:14 PM
2019-04-02 16:14:44 (UTC+2)
Log In to Comment