[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to convert a md5sum back to a timestamp?
From: |
Stephane Chazelas |
Subject: |
Re: How to convert a md5sum back to a timestamp? |
Date: |
Thu, 1 Aug 2019 10:46:15 +0100 |
User-agent: |
NeoMutt/20171215 |
2019-08-01 02:08:59 -0600, Assaf Gordon:
[...]
> Three notes:
> 1.
> I would recommend using "-%7.0f minutes" format in "seq"
> instead of "%g", as the latter will result in a scientific notation
> for large values:
>
> $ seq -f '-%7g minutes' 2563200 | tail -n1
> -2.5632e+06 minutes
>
> $ seq -f '-%7.0f minutes' 2563200 | tail -n1
> -2563200 minutes
Good point, though
$ seq -f '-%7.0f minutes' 1
- 1 minutes
You'd want:
seq -f '-%.0f minutes' 2563200
Or
seq -f '%.0f minutes' -- -1 -1 -2563200
[...]
> For reference, on my old desktop it takes:
>
> $ time seq -f "2019-08-01 01:53:22Z +%7.0f minutes" 2563200 \
> | date -u -f - +%Y%m%d_%I%M%p \
> | datamash --full md5 1 | wc -l -c
> 2563200 125596800
>
> real 0m14.185s
> user 0m17.739s
> sys 0m0.527s
>
> And results in ~125MB of data - reasonable for an ad-hoc reverse
> lookup table for MD5 values.
[...]
Thanks. I definitely need to have a better look at datamash.
--
Stephane