{"id":880,"date":"2022-08-19T06:38:31","date_gmt":"2022-08-19T06:38:31","guid":{"rendered":"https:\/\/craftcookcode.com\/?p=880"},"modified":"2024-07-10T02:37:54","modified_gmt":"2024-07-10T02:37:54","slug":"python-unpacking-a-comp-3-number","status":"publish","type":"post","link":"https:\/\/craftcookcode.com\/?p=880","title":{"rendered":"Python &#8211; Unpacking a COMP-3 number"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">New business requirement today.&nbsp; We have some old mainframe files we have to run through Qlik Replicate.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Three problems we have to overcome:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The files are in fixed width format<\/li>\n\n\n\n<li>The files are in EBCDIC format; specifically <a href=\"https:\/\/en.wikipedia.org\/wiki\/Code_page_37#1047\">Code 1047<\/a><\/li>\n\n\n\n<li>Inside the records there are comp-3 packed fields\u00a0<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">The mainframe team did kindly provide us with a schema file that showed us the how many bytes make up each field so we could divide up the fixed width file by reading in a certain number of bytes per a field.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Python provided a decode function to decode the fields read to a readable format:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfocus_data_ascii = focus_data.decode(&quot;cp1047&quot;).rstrip()\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">The hard part now was the comp-3 packed fields. They are made up with some bit magic and working with bits and shifts is not my strongest suite&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I have been a bit spoilt so far working with python and most problems can be solved by &#8220;find the module to do the magic for you.&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But after ages of scouring for a module to handle the conversion for me; I had a lot of false leads &#8211; testing questionable code with no luck.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Eventually I stumbles upon:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/gist.github.com\/zorchenhimer\/fd4d4208312d4175d106\">zorchenhimer\/cobol-packed-numbers.py<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank goodness.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It still works with bits &#8216;n&#8217; shift magic &#8211; but it works on the data that I have and now have readable text&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I extended the code to fulfil the business requirements:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# Source https:\/\/gist.github.com\/zorchenhimer\/fd4d4208312d4175d106\ndef unpack_number(field, no_decimals):\n  \u00a0 &quot;&quot;&quot; Unpack a COMP-3 number. &quot;&quot;&quot;\n  \u00a0 a = array(&#039;B&#039;, field)\n  \u00a0 value = float(0)\n\n\u00a0 \u00a0 # For all but last digit (half byte)\n  \u00a0 for focus_half_byte in a&#x5B;:-1]:\n  \u00a0 \u00a0 \u00a0 value = (value * 100) + ( ( (focus_half_byte &amp; 0xf0) &gt;&gt; 4) * 10) + (focus_half_byte &amp; 0xf)\n\n\u00a0 \u00a0 # Last digit\n  \u00a0 focus_half_byte = a&#x5B;-1]\n  \u00a0 value = (value * 10) + ((focus_half_byte &amp; 0xf0) &gt;&gt; 4)\n\n\u00a0 \u00a0 # Negative\/Positve check. \u00a0If 0xd; it is a negative value\n  \u00a0 if (focus_half_byte &amp; 0xf) == 0xd:\n  \u00a0 \u00a0 \u00a0 value = value * -1\n\n\u00a0 \u00a0 # If no_decimals = 0; it is just an int\n  \u00a0 if no_decimals == 0:\n  \u00a0 \u00a0 \u00a0 return_int = int(value)\n  \u00a0 \u00a0 \u00a0 return (return_int)\n  \u00a0 else:\n  \u00a0 \u00a0 \u00a0 return_float = value \/ pow(10, no_decimals)\n  \u00a0 \u00a0 \u00a0 return (return_float)\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>New business requirement today.&nbsp; We have some old mainframe files we have to run through Qlik Replicate. Three problems we have to overcome: The mainframe team&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[13,18],"tags":[],"class_list":["post-880","post","type-post","status-publish","format-standard","hentry","category-code","category-python"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"New business requirement today. We have some old mainframe files we have to run through Qlik Replicate. Three problems we have to overcome: The files are in fixed width format The files are in EBCDIC format; specifically Code 1047 Inside the records there are comp-3 packed fields The mainframe team did kindly provide us with\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"jonny.donker@gmail.com\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/craftcookcode.com\/?p=880\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Craft Cook Code - c^3?\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Python \u2013 Unpacking a COMP-3 number - Craft Cook Code\" \/>\n\t\t<meta property=\"og:description\" content=\"New business requirement today. We have some old mainframe files we have to run through Qlik Replicate. Three problems we have to overcome: The files are in fixed width format The files are in EBCDIC format; specifically Code 1047 Inside the records there are comp-3 packed fields The mainframe team did kindly provide us with\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/craftcookcode.com\/?p=880\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2022-08-19T06:38:31+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2024-07-10T02:37:54+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Python \u2013 Unpacking a COMP-3 number - Craft Cook Code\" \/>\n\t\t<meta name=\"twitter:description\" content=\"New business requirement today. We have some old mainframe files we have to run through Qlik Replicate. Three problems we have to overcome: The files are in fixed width format The files are in EBCDIC format; specifically Code 1047 Inside the records there are comp-3 packed fields The mainframe team did kindly provide us with\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=880#blogposting\",\"name\":\"Python \\u2013 Unpacking a COMP-3 number - Craft Cook Code\",\"headline\":\"Python &#8211; Unpacking a COMP-3 number\",\"author\":{\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?author=1#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=880#articleImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/12ea7810156e378894993fa29611c905482263dd05898a50ae5ece294bb6aff0?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"jonny.donker@gmail.com\"},\"datePublished\":\"2022-08-19T06:38:31+00:00\",\"dateModified\":\"2024-07-10T02:37:54+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=880#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=880#webpage\"},\"articleSection\":\"Code, Python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=880#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/craftcookcode.com#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/craftcookcode.com\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?cat=13#listItem\",\"name\":\"Code\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?cat=13#listItem\",\"position\":2,\"name\":\"Code\",\"item\":\"https:\\\/\\\/craftcookcode.com\\\/?cat=13\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?cat=18#listItem\",\"name\":\"Python\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/craftcookcode.com#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?cat=18#listItem\",\"position\":3,\"name\":\"Python\",\"item\":\"https:\\\/\\\/craftcookcode.com\\\/?cat=18\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=880#listItem\",\"name\":\"Python &#8211; Unpacking a COMP-3 number\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?cat=13#listItem\",\"name\":\"Code\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=880#listItem\",\"position\":4,\"name\":\"Python &#8211; Unpacking a COMP-3 number\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?cat=18#listItem\",\"name\":\"Python\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/#person\",\"name\":\"jonny.donker@gmail.com\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=880#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/12ea7810156e378894993fa29611c905482263dd05898a50ae5ece294bb6aff0?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"jonny.donker@gmail.com\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?author=1#author\",\"url\":\"https:\\\/\\\/craftcookcode.com\\\/?author=1\",\"name\":\"jonny.donker@gmail.com\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=880#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/12ea7810156e378894993fa29611c905482263dd05898a50ae5ece294bb6aff0?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"jonny.donker@gmail.com\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=880#webpage\",\"url\":\"https:\\\/\\\/craftcookcode.com\\\/?p=880\",\"name\":\"Python \\u2013 Unpacking a COMP-3 number - Craft Cook Code\",\"description\":\"New business requirement today. We have some old mainframe files we have to run through Qlik Replicate. Three problems we have to overcome: The files are in fixed width format The files are in EBCDIC format; specifically Code 1047 Inside the records there are comp-3 packed fields The mainframe team did kindly provide us with\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?p=880#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?author=1#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/?author=1#author\"},\"datePublished\":\"2022-08-19T06:38:31+00:00\",\"dateModified\":\"2024-07-10T02:37:54+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/#website\",\"url\":\"https:\\\/\\\/craftcookcode.com\\\/\",\"name\":\"Craft Cook Code\",\"description\":\"c^3?\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/craftcookcode.com\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Python \u2013 Unpacking a COMP-3 number - Craft Cook Code","description":"New business requirement today. We have some old mainframe files we have to run through Qlik Replicate. Three problems we have to overcome: The files are in fixed width format The files are in EBCDIC format; specifically Code 1047 Inside the records there are comp-3 packed fields The mainframe team did kindly provide us with","canonical_url":"https:\/\/craftcookcode.com\/?p=880","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/craftcookcode.com\/?p=880#blogposting","name":"Python \u2013 Unpacking a COMP-3 number - Craft Cook Code","headline":"Python &#8211; Unpacking a COMP-3 number","author":{"@id":"https:\/\/craftcookcode.com\/?author=1#author"},"publisher":{"@id":"https:\/\/craftcookcode.com\/#person"},"image":{"@type":"ImageObject","@id":"https:\/\/craftcookcode.com\/?p=880#articleImage","url":"https:\/\/secure.gravatar.com\/avatar\/12ea7810156e378894993fa29611c905482263dd05898a50ae5ece294bb6aff0?s=96&d=mm&r=g","width":96,"height":96,"caption":"jonny.donker@gmail.com"},"datePublished":"2022-08-19T06:38:31+00:00","dateModified":"2024-07-10T02:37:54+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/craftcookcode.com\/?p=880#webpage"},"isPartOf":{"@id":"https:\/\/craftcookcode.com\/?p=880#webpage"},"articleSection":"Code, Python"},{"@type":"BreadcrumbList","@id":"https:\/\/craftcookcode.com\/?p=880#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/craftcookcode.com#listItem","position":1,"name":"Home","item":"https:\/\/craftcookcode.com","nextItem":{"@type":"ListItem","@id":"https:\/\/craftcookcode.com\/?cat=13#listItem","name":"Code"}},{"@type":"ListItem","@id":"https:\/\/craftcookcode.com\/?cat=13#listItem","position":2,"name":"Code","item":"https:\/\/craftcookcode.com\/?cat=13","nextItem":{"@type":"ListItem","@id":"https:\/\/craftcookcode.com\/?cat=18#listItem","name":"Python"},"previousItem":{"@type":"ListItem","@id":"https:\/\/craftcookcode.com#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/craftcookcode.com\/?cat=18#listItem","position":3,"name":"Python","item":"https:\/\/craftcookcode.com\/?cat=18","nextItem":{"@type":"ListItem","@id":"https:\/\/craftcookcode.com\/?p=880#listItem","name":"Python &#8211; Unpacking a COMP-3 number"},"previousItem":{"@type":"ListItem","@id":"https:\/\/craftcookcode.com\/?cat=13#listItem","name":"Code"}},{"@type":"ListItem","@id":"https:\/\/craftcookcode.com\/?p=880#listItem","position":4,"name":"Python &#8211; Unpacking a COMP-3 number","previousItem":{"@type":"ListItem","@id":"https:\/\/craftcookcode.com\/?cat=18#listItem","name":"Python"}}]},{"@type":"Person","@id":"https:\/\/craftcookcode.com\/#person","name":"jonny.donker@gmail.com","image":{"@type":"ImageObject","@id":"https:\/\/craftcookcode.com\/?p=880#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/12ea7810156e378894993fa29611c905482263dd05898a50ae5ece294bb6aff0?s=96&d=mm&r=g","width":96,"height":96,"caption":"jonny.donker@gmail.com"}},{"@type":"Person","@id":"https:\/\/craftcookcode.com\/?author=1#author","url":"https:\/\/craftcookcode.com\/?author=1","name":"jonny.donker@gmail.com","image":{"@type":"ImageObject","@id":"https:\/\/craftcookcode.com\/?p=880#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/12ea7810156e378894993fa29611c905482263dd05898a50ae5ece294bb6aff0?s=96&d=mm&r=g","width":96,"height":96,"caption":"jonny.donker@gmail.com"}},{"@type":"WebPage","@id":"https:\/\/craftcookcode.com\/?p=880#webpage","url":"https:\/\/craftcookcode.com\/?p=880","name":"Python \u2013 Unpacking a COMP-3 number - Craft Cook Code","description":"New business requirement today. We have some old mainframe files we have to run through Qlik Replicate. Three problems we have to overcome: The files are in fixed width format The files are in EBCDIC format; specifically Code 1047 Inside the records there are comp-3 packed fields The mainframe team did kindly provide us with","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/craftcookcode.com\/#website"},"breadcrumb":{"@id":"https:\/\/craftcookcode.com\/?p=880#breadcrumblist"},"author":{"@id":"https:\/\/craftcookcode.com\/?author=1#author"},"creator":{"@id":"https:\/\/craftcookcode.com\/?author=1#author"},"datePublished":"2022-08-19T06:38:31+00:00","dateModified":"2024-07-10T02:37:54+00:00"},{"@type":"WebSite","@id":"https:\/\/craftcookcode.com\/#website","url":"https:\/\/craftcookcode.com\/","name":"Craft Cook Code","description":"c^3?","inLanguage":"en-US","publisher":{"@id":"https:\/\/craftcookcode.com\/#person"}}]},"og:locale":"en_US","og:site_name":"Craft Cook Code - c^3?","og:type":"article","og:title":"Python \u2013 Unpacking a COMP-3 number - Craft Cook Code","og:description":"New business requirement today. We have some old mainframe files we have to run through Qlik Replicate. Three problems we have to overcome: The files are in fixed width format The files are in EBCDIC format; specifically Code 1047 Inside the records there are comp-3 packed fields The mainframe team did kindly provide us with","og:url":"https:\/\/craftcookcode.com\/?p=880","article:published_time":"2022-08-19T06:38:31+00:00","article:modified_time":"2024-07-10T02:37:54+00:00","twitter:card":"summary_large_image","twitter:title":"Python \u2013 Unpacking a COMP-3 number - Craft Cook Code","twitter:description":"New business requirement today. We have some old mainframe files we have to run through Qlik Replicate. Three problems we have to overcome: The files are in fixed width format The files are in EBCDIC format; specifically Code 1047 Inside the records there are comp-3 packed fields The mainframe team did kindly provide us with"},"aioseo_meta_data":{"post_id":"880","title":null,"description":null,"keywords":null,"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"BlogPosting","isEnabled":true},"graphs":[],"defaultGraph":"Article","defaultPostTypeGraph":""},"schema_type":"default","schema_type_options":"{\"article\":{\"articleType\":\"BlogPosting\"},\"course\":{\"name\":\"\",\"description\":\"\",\"provider\":\"\"},\"faq\":{\"pages\":[]},\"product\":{\"reviews\":[]},\"recipe\":{\"ingredients\":[],\"instructions\":[],\"keywords\":[]},\"software\":{\"reviews\":[],\"operatingSystems\":[]},\"webPage\":{\"webPageType\":\"WebPage\"},\"blockGraphs\":[]}","pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2022-08-19 06:40:57","updated":"2025-06-04 12:26:50","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/craftcookcode.com\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/craftcookcode.com\/?cat=13\" title=\"Code\">Code<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/craftcookcode.com\/?cat=18\" title=\"Python\">Python<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tPython \u2013 Unpacking a COMP-3 number\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/craftcookcode.com"},{"label":"Code","link":"https:\/\/craftcookcode.com\/?cat=13"},{"label":"Python","link":"https:\/\/craftcookcode.com\/?cat=18"},{"label":"Python &#8211; Unpacking a COMP-3 number","link":"https:\/\/craftcookcode.com\/?p=880"}],"_links":{"self":[{"href":"https:\/\/craftcookcode.com\/index.php?rest_route=\/wp\/v2\/posts\/880","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/craftcookcode.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/craftcookcode.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/craftcookcode.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/craftcookcode.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=880"}],"version-history":[{"count":5,"href":"https:\/\/craftcookcode.com\/index.php?rest_route=\/wp\/v2\/posts\/880\/revisions"}],"predecessor-version":[{"id":1459,"href":"https:\/\/craftcookcode.com\/index.php?rest_route=\/wp\/v2\/posts\/880\/revisions\/1459"}],"wp:attachment":[{"href":"https:\/\/craftcookcode.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=880"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/craftcookcode.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=880"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/craftcookcode.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=880"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}