-
Notifications
You must be signed in to change notification settings - Fork 3
/
Cargo.toml
80 lines (70 loc) · 2.56 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
[package]
name = "ciid"
version = "0.2.1-alpha.0"
authors = ["Pablo Sichert <[email protected]>"]
description = """
`ciid` is a utility to derive a chronologically sortable, unique identifier for
images.
Usually, digital cameras and phones assign file names to images with a sequence
of only 4 digits (e.g. `IMG_1234.dng`). Those names will easily clash for any
sufficiently large amount of images.
`ciid` tackles this problem by deriving a hash from the image buffer.
Additionally to being able to derive an identifier that is very unlikely to
clash, this hash can later be used to check the integrity of the image content.
Some image processing programs update metadata of files (e.g inline JPEG-
previews, tags, modified date). The resulting `ciid` will be unaffected from
those changes, since only the actual image buffer is hashed. This has the nice
side-effect that proprietary camera RAW file formats and converted `.dng` files
will yield the same identifier most of the time.
Here's how a resulting identifier looks like:
```
01234567890123-a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1
└─────┬──────┘ └──────────────────────────────┬───────────────────────────────┘
timestamp hash of image buffer
```
The first part of the identifier encodes the creation date of the image (a unix
timestamp with millisecond precision), while the second part is a hash (SHA-256)
based on the contents of the image buffer.
Following criteria were considered when choosing the identifier:
- have sensible alphabetical ordering on file systems (timestamps with a higher
value should appear strictly after lower ones)
- encode information sufficiently compact
- be safe to use in URLs"""
documentation = "https://github.com/pablosichert/ciid"
homepage = "https://github.com/pablosichert/ciid"
repository = "https://github.com/pablosichert/ciid"
readme = "README.md"
keywords = [
"chronological",
"identifier",
"image",
"sortable",
"unique"
]
categories = [
"command-line-utilities",
"filesystem",
"multimedia::encoding",
"multimedia::images",
"multimedia"
]
license = "MIT"
include = [
"build.rs",
"LICENSE",
"README.md",
"src"
]
edition = "2018"
[dependencies]
bindgen = "0.53.1"
chrono = "0.4.10"
clap = "2.33"
data-encoding = "2.1"
image = "0.23.0"
regex = "1.3"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
sha2 = "0.8.1"
[build-dependencies]
bindgen = "0.53.1"