{"id":16994594,"url":"https://github.com/znerol/py-idlk","last_synced_at":"2025-03-22T05:43:32.596Z","repository":{"id":33503473,"uuid":"37149431","full_name":"znerol/py-idlk","owner":"znerol","description":"idlk lock filename generator","archived":false,"fork":false,"pushed_at":"2016-02-23T08:46:26.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T08:01:31.525Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/znerol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-09T18:10:25.000Z","updated_at":"2018-10-01T14:39:44.000Z","dependencies_parsed_at":"2022-08-07T22:00:17.633Z","dependency_job_id":null,"html_url":"https://github.com/znerol/py-idlk","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znerol%2Fpy-idlk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znerol%2Fpy-idlk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znerol%2Fpy-idlk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znerol%2Fpy-idlk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/znerol","download_url":"https://codeload.github.com/znerol/py-idlk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244913005,"owners_count":20530769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T03:46:01.138Z","updated_at":"2025-03-22T05:43:32.563Z","avatar_url":"https://github.com/znerol.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python idlk\n\n[![Build Status](https://travis-ci.org/znerol/py-idlk.svg?branch=master)](https://travis-ci.org/znerol/py-idlk)\n[![Coverage Status](https://coveralls.io/repos/github/znerol/py-idlk/badge.svg?branch=master)](https://coveralls.io/github/znerol/py-idlk?branch=master)\n\nThis is a proof-of-concept implementation of a lock filename generator for idlk\nfiles used by a well known desktop publishing suite.\n\n\n## Usage\n\n```\n    from idlk import idlk\n\n    lockname = idlk(u'My Layout File.INDD')\n    # lockname == u'~my layout file~q7e)nv.idlk'\n\n    lockname = idlk(u'My Text.icml')\n    # lockname == u'~my text~7h5m7u.idlk'\n```\n\n\n## Technical details\n\nThe names of the lockfiles are derived from a given file name with the\nfollowing steps:\n\n1. Apply NFC unicode normalization.\n2. Convert the complete filename to lower case.\n3. Switch to Mac Roman encoding.\n4. Generate a 32bit hash value over the whole file name and encode it using a\n   custom base41 encoding scheme.\n5. Remove extension from the prepared file name, shorten it further to 18\n   characters if necessary.\n6. Generate the idlk file name using the following pattern:\n   ~shortened-lowercase-basename[1..18]~hash[6].idlk\n\nNote: Even though the hash-function is rather primitive, there is no way of\ndirectly deriving the original document name for a given idlk name.\n\n\n### Hash function\n\nThe hash function is a very simple shift-add function. The only tricky/weird\nthing is a final modulo with the magic number `0xFFFEECED`.\n\n\n### Base41 encoding\n\nBase41 produces a case insensitive string containing digits `0-9`, characters\n`a-z` and the 5 additional characters `-`, `_`, `(`, `)` and `$`.\n\n\n## Caveats\n\nThe algorithm has been deduced after observing the behavior of the original\nsoftware. It currently only works with file names which are completely mappable\nto the Mac Roman encoding.\n\n\n## License\n\nAll code and documentation is released under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fznerol%2Fpy-idlk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fznerol%2Fpy-idlk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fznerol%2Fpy-idlk/lists"}