Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

add unix timestamp support #85

Merged
merged 10 commits into from
Jul 2, 2021
Merged

Conversation

Granitosaurus
Copy link
Contributor

Hello,
for my first contributions I've picked something simple: unix epoch timestamps:

$ poetry run pywhat 1623914861

Possible Identification
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Matched Text ┃ Identified as         ┃ Description                                             ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 1623914861   │ Recent Unix Timestamp │ Seconds elapsed since unix epoch: 1970, between year    │
│              │                       │ 2001 and 2286                                           │
├──────────────┼───────────────────────┼─────────────────────────────────────────────────────────┤
│ 1623914861   │ Phone Number          │ None                                                    │
├──────────────┼───────────────────────┼─────────────────────────────────────────────────────────┤
│ 1623914861   │ Unix Timestamp        │ Seconds elapsed since unix epoch: 1970                  │
└──────────────┴───────────────────────┴─────────────────────────────────────────────────────────┘

and milliseconds:

$ poetry run pywhat 1623914861000

Possible Identification
┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Matched Text  ┃ Identified as                     ┃ Description                                ┃
┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 1623914861000 │ Recent Unix Millisecond Timestamp │ Milliseconds elapsed since unix epoch:     │
│               │                                   │ 1970, between year 2001 and 2286           │
├───────────────┼───────────────────────────────────┼────────────────────────────────────────────┤
│ 1623914861000 │ Phone Number                      │ None                                       │
├───────────────┼───────────────────────────────────┼────────────────────────────────────────────┤
│ 1623914861000 │ Unix Millisecond Timestamp        │ Milliseconds elapsed since unix epoch:     │
│               │                                   │ 1970                                       │
└───────────────┴───────────────────────────────────┴────────────────────────────────────────────┘

I think it would be great to support non-regex identifiers as this could have been done much more gracefully in python with datetime module. Nevertheless here's regex based implementation! :)

@bee-san
Copy link
Owner

bee-san commented Jun 17, 2021

I think it would be great to support non-regex identifiers
🔜 😉

@bee-san
Copy link
Owner

bee-san commented Jun 17, 2021

@amadejpapez @piatrashkakanstantinass what do you think of the rarity here? 0.8? :)

@Granitosaurus
Copy link
Contributor Author

Granitosaurus commented Jun 17, 2021

There's another caveat here that timestamps < 1970-04-28 not gonna match as they're less than 8 numbers long - those first 5 months though are hard to reach without introducing a lot of false-positives

@ghost
Copy link

ghost commented Jun 17, 2021

@amadejpapez @piatrashkakanstantinass what do you think of the rarity here? 0.8? :)

I would use 0.5 here.

@bee-san
Copy link
Owner

bee-san commented Jun 17, 2021

@Granitosaurus thanks for the heads up! We'll add it to the tech-debt register (when I make one!) and when we introduce cooler checks we can do stuff like this :) I think the checks are a github issue somewhere 😓

@Granitosaurus
Copy link
Contributor Author

reduced rarity to 0.5 as recommended.

@bee-san
Copy link
Owner

bee-san commented Jun 26, 2021

Merge conflicts! :(

@ghost
Copy link

ghost commented Jul 2, 2021

@Granitosaurus merge conflicts 😢

@amadejpapez
Copy link
Collaborator

Should be good to go now

@ghost ghost requested a review from bee-san July 2, 2021 18:54
@amadejpapez amadejpapez merged commit 351b9ad into bee-san:main Jul 2, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants