{"id":16122034,"url":"https://github.com/foxcapades/renpy-util-hex","last_synced_at":"2025-04-06T11:40:49.959Z","repository":{"id":185440064,"uuid":"673539343","full_name":"Foxcapades/renpy-util-hex","owner":"Foxcapades","description":"Hex utils.","archived":false,"fork":false,"pushed_at":"2023-08-12T16:40:18.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-12T17:19:18.582Z","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/Foxcapades.png","metadata":{"files":{"readme":"readme.adoc","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-01T21:33:08.000Z","updated_at":"2023-08-01T21:49:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"7929825c-f645-434a-b94c-71677eebebae","html_url":"https://github.com/Foxcapades/renpy-util-hex","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"70d848248d93e11394ba28c4e8f1bf8f2e1edf74"},"previous_names":["foxcapades/renpy-util-hex"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Frenpy-util-hex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Frenpy-util-hex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Frenpy-util-hex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Frenpy-util-hex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Foxcapades","download_url":"https://codeload.github.com/Foxcapades/renpy-util-hex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478234,"owners_count":20945262,"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-09T21:09:08.375Z","updated_at":"2025-04-06T11:40:49.933Z","avatar_url":"https://github.com/Foxcapades.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Ren'Py Hex Utils\n:toc:\n\nProvides a collection of utility functions for parsing and rendering hex values\nfrom/to ints or iterables of bytes.\n\nThis is intended to be used as part of other projects.\n\n\n== Functions\n\nAll functions are prefixed with `fox_` to avoid conflicts with any other\ntooling.\n\n[NOTE]\n--\nIn the following function signatures, arguments suffixed with a `?` character\nare optional.\n--\n\n\n=== `fox_int_to_hex(value, min_width?, prefix?, upper?)`\n\nConverts the given int value into a hex string with an optional prefix.\n\nInt values must be greater than or equal to zero.\n\n==== Arguments\n\n`value : int`::\nPositive (or zero) int value to convert to a hex string.\n\n`min_width : int`::\nOptional, positive int value that specifies the minimum width in characters of\nthe returned hex string (minus the prefix).  If the int value is not large\nenough to meet this min width, the the hex string will be left-padded with\nzeros.\n+\nDefault = `2`\n\n`prefix : str`::\nOptional prefix value that will be prepended onto the returned hex value.\nCommon examples include `#` and `0x`.\n+\nDefault = `''`\n\n`upper : bool`::\nWhether the returned hex string should be uppercased.\n+\nDefault = `False`\n\n\n==== Returns\n\n`str`::\nThe generated hex string.\n\n\n=== `fox_hex_to_int(value, prefix?)`\n\nConverts the given hex string into an int value.  Hex string is considered\nbig-endian.\n\n==== Arguments\n\n`value : str`::\nHex string that will be parsed into an int value.\n\n`prefix : str`::\nPrefix that will be stripped off the given value before it is parsed.\n\n==== Returns\n\n`int`::\nThe int value parsed from the given hex string.\n\n\n=== `fox_ubytes_to_hex(bytes, prefix?, upper?)`\n\nTakes the given list, tuple, or other iterable and translates the ubyte values\nfetched from that iterable into a singular hex string.\n\nThe iterable is expected to return the ubytes in big-endian order.\n\n==== Arguments\n\n`bytes : any`::\nA list, tuple, or other iterable type from which ubyte values will be retrieved.\n\n`prefix : str`::\nOptional prefix that will be prepended to the output hex string.  Common\nexamples include `#` and `0x`.\n+\nDefault = `''`\n\n`upper : bool`::\nFlag indicating whether the returned hex should be uppercase.\n+\nDefault = `False`\n\n==== Returns\n\n`str`::\nA hex string build for the bytes retrieved from the given list, tuple, or other\niterable.\n\n\n=== `fox_hex_to_ubytes(value, prefix?)`\n\nConverts the given hex string into a list of ubyte values.\n\n==== Arguments\n\n`value : str`::\nHex string that will be parsed into a list of ubytes.\n\n`prefix : str`::\nPrefix that will be stripped off of the given value before it is parsed.\n\n==== Returns\n\n`list[int]`::\nA list of ubyte values parsed from the given hex string.\n\n\n=== `fox_ubyte_to_hex(byte, upper?)`\n\nConverts the given ubyte value to a hex character pair in a string.\n\n==== Arguments\n\n`byte : int`::\nUByte value to convert to hex.  This value must be between `0` and `255`\n(inclusive) or an exception will be raised.\n\n`upper : bool`::\nFlag indicating whether the returned hex should be uppercase.\n+\nDefault = `False`\n\n==== Returns\n\n`str`::\nA 2 character hex string representing the given ubyte value.\n\n\n=== `fox_hex_is_valid(hex)`\n\nTests whether the given value is a hex string.  Assumes that any prefixes have\nbeen removed before testing.\n\n==== Arguments\n\n`hex : str`::\nValue to test.\n\n==== Returns\n\n`bool`::\nWhether the given value was a valid hex string.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxcapades%2Frenpy-util-hex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoxcapades%2Frenpy-util-hex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxcapades%2Frenpy-util-hex/lists"}