Skip to content

Commit

Permalink
Include lib version in ID hash, adjust metadata indentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
camelpunch committed Oct 22, 2024
1 parent 1589a0d commit 855d6c9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions lib/mudbrick/metadata.ex
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ defmodule Mudbrick.Metadata do
document_id,
"""
</xmpMM:DocumentID>
<xmpMM:InstanceID>\
<xmpMM:InstanceID>\
""",
instance_id,
"""
Expand Down Expand Up @@ -85,7 +85,7 @@ defmodule Mudbrick.Metadata do
end

defp id(opts) do
:crypto.hash(:sha256, inspect(opts))
:crypto.hash(:sha256, [Application.spec(:mudbrick)[:vsn], inspect(opts)])
|> Base.encode64(padding: false)
end
end
48 changes: 24 additions & 24 deletions test/mudbrick_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ defmodule MudbrickTest do
3 0 obj
<</Type /Metadata
/Subtype /XML
/Length 1042
/Length 1043
>>
stream
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
Expand All @@ -121,8 +121,8 @@ defmodule MudbrickTest do
</dc:title>
</rdf:Description>
<rdf:Description rdf:about="" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/">
<xmpMM:DocumentID>/aqULtTrBy1/G8uKIgoObFx4RRZpMG/nCojsDy26YOc</xmpMM:DocumentID>
<xmpMM:InstanceID>ZzBsu+wjW0fPjubUZGQhCkklz6Jw67Gx+Qj0Nc4L4Uk</xmpMM:InstanceID>
<xmpMM:DocumentID>OZwlvvscl2EvtNnawU3bf4LcjVKMXc7miQZtxrzmFCk</xmpMM:DocumentID>
<xmpMM:InstanceID>z1MfnkCKfrWi4OT2JJpEYwwMAc28M/7FlCLRHXNRAss</xmpMM:InstanceID>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
Expand Down Expand Up @@ -191,18 +191,18 @@ defmodule MudbrickTest do
0000000023 00000 n
0000000125 00000 n
0000000229 00000 n
0000001356 00000 n
0000001490 00000 n
0000001558 00000 n
0000001652 00000 n
0000001790 00000 n
0000001886 00000 n
0000001357 00000 n
0000001491 00000 n
0000001559 00000 n
0000001653 00000 n
0000001791 00000 n
0000001887 00000 n
trailer
<</Root 5 0 R
/Size 10
>>
startxref
1939
1940
%%EOF\
"""
end
Expand All @@ -218,7 +218,7 @@ defmodule MudbrickTest do
1 0 obj
<</Type /Metadata
/Subtype /XML
/Length 1042
/Length 1043
>>
stream
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
Expand All @@ -239,8 +239,8 @@ defmodule MudbrickTest do
</dc:title>
</rdf:Description>
<rdf:Description rdf:about="" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/">
<xmpMM:DocumentID>T1PNoYwrqgwDVLtfmj7L5e0Sq02OEbqHPC8RFhICuUU</xmpMM:DocumentID>
<xmpMM:InstanceID>KMdbFiJuJL2vUCqI9jJB/TN84ka0KLXNcewGIRwbZyc</xmpMM:InstanceID>
<xmpMM:DocumentID>tmkxRntcYJxXApecOCsIkUzOKj982KUmBE28bsh/Btw</xmpMM:DocumentID>
<xmpMM:InstanceID>hfuu1Fk+glpWfauCVDrYAyuxMOSG+1ZzxKrGCxzE+XY</xmpMM:InstanceID>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
Expand Down Expand Up @@ -284,16 +284,16 @@ defmodule MudbrickTest do
0 6
0000000000 65535 f
0000000023 00000 n
0000001150 00000 n
0000001257 00000 n
0000001325 00000 n
0000001421 00000 n
0000001151 00000 n
0000001258 00000 n
0000001326 00000 n
0000001422 00000 n
trailer
<</Root 3 0 R
/Size 6
>>
startxref
1474
1475
%%EOF\
"""
end
Expand All @@ -308,7 +308,7 @@ defmodule MudbrickTest do
1 0 obj
<</Type /Metadata
/Subtype /XML
/Length 1042
/Length 1043
>>
stream
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
Expand All @@ -329,8 +329,8 @@ defmodule MudbrickTest do
</dc:title>
</rdf:Description>
<rdf:Description rdf:about="" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/">
<xmpMM:DocumentID>T1PNoYwrqgwDVLtfmj7L5e0Sq02OEbqHPC8RFhICuUU</xmpMM:DocumentID>
<xmpMM:InstanceID>KMdbFiJuJL2vUCqI9jJB/TN84ka0KLXNcewGIRwbZyc</xmpMM:InstanceID>
<xmpMM:DocumentID>tmkxRntcYJxXApecOCsIkUzOKj982KUmBE28bsh/Btw</xmpMM:DocumentID>
<xmpMM:InstanceID>hfuu1Fk+glpWfauCVDrYAyuxMOSG+1ZzxKrGCxzE+XY</xmpMM:InstanceID>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
Expand Down Expand Up @@ -359,14 +359,14 @@ defmodule MudbrickTest do
0 4
0000000000 65535 f
0000000023 00000 n
0000001150 00000 n
0000001252 00000 n
0000001151 00000 n
0000001253 00000 n
trailer
<</Root 3 0 R
/Size 4
>>
startxref
1320
1321
%%EOF\
"""
end
Expand Down

0 comments on commit 855d6c9

Please sign in to comment.