[tz] ID string in zic's output files

Steven R. Loomis srl at icu-project.org
Wed Feb 22 23:03:27 UTC 2017


Thanks for checking on this.

Well… one could store a 15 byte *hash of the ID string*.

$ echo -n 'America/Indiana/Vevay' | shasum -a 1 | cut -c1-30
3fec11cdc40957c5e5c8ab69ca3a68

$ echo -n 'America/Los_Angeles' | shasum -a 1 | cut -c1-30
c5095924a41ac815d5f355767d82b1

$ cd /usr/share/zoneinfo/ ; ( for z in $(find . -type f | cut -d/ -f2-);
do echo $(echo -n $z | shasum -a 1 | cut -c1-30) $z; done) | fgrep
c5095924a41ac815d5f355767d82b1

c5095924a41ac815d5f355767d82b1 America/Los_Angeles

On 2/22/17 2:41 PM, Arthur David Olson wrote:
> So much for the idea of storing ID strings in zic output files as
> (unused) abbreviations. The zone America/Pangnirtung needs 41 bytes to
> store all the abbreviations it uses:
>     -00 AWT APT AST ADDT ADT EDT EST CST CDT
> A zic output file can have at most 50 bytes of abbreviations, as set
> by TZ_MAX_CHARS in tzfile.h The 9 bytes remaining isn't enough for our
> purposes.
>
> (We don't want to boost TZ_MAX_CHARS; localtime.c checks files to
> ensure they have at most that many abbreviation characters; files with
> more would be rejected, at least by now-in-the-field binaries compiled
> from localtime.c)
>
> Note that the last component of "Zone" names (such as the "Vevay" in
> "America/Indiana/Vevay") would  fit in the 15 "reserved for future
> use" bytes at the front of zic output files; full names would not
> (always) fit, and there would not (always) be room for a prefix such
> as "@(#)."
>
>     @dashdashado


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <http://mm.icann.org/pipermail/tz/attachments/20170222/b08a2e41/signature.asc>


More information about the tz mailing list