{"id":476,"date":"2010-08-03T19:20:28","date_gmt":"2010-08-03T18:20:28","guid":{"rendered":"http:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/"},"modified":"2010-08-03T19:20:28","modified_gmt":"2010-08-03T18:20:28","slug":"more-perl-6-development-stringcrc32","status":"publish","type":"post","link":"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/","title":{"rendered":"More Perl 6 development, String::CRC32"},"content":{"rendered":"<p>A couple of days were plenty enough to whip up a new <a href=\"http:\/\/www.rakudo.org\" rel=\"nofollow\">Perl 6<\/a> module, <a href=\"http:\/\/github.com\/cosimo\/perl6-string-crc32\" rel=\"nofollow\">String::CRC32<\/a>.<\/p>\n<p>This is a straight conversion from the Perl 5 CPAN version of <a href=\"http:\/\/search.cpan.org\/dist\/String-CRC32\/\" rel=\"nofollow\">String::CRC32<\/a>. That one uses some C\/XS code though. I wrote the equivalent in Perl 6. Was quite simple actually, once I learned a bit more on <a href=\"http:\/\/perlcabal.org\/syn\/S03.html#Additive_precedence\" rel=\"nofollow\">numeric bitwise operators<\/a>.<\/p>\n<p>The classic <code>||<\/code> and <code>&amp;&amp;<\/code> for bitwise &quot;OR&quot; and &quot;AND&quot; are now written as:<\/p>\n<pre><code>\r\nBitwise OR  &#39;+|&#39;\r\nBitwise AND &#39;+&amp;&#39;\r\nBitwise XOR &#39;+^&#39;\r\n<\/code><\/pre>\n<p>So the following code:<\/p>\n<pre><code>\r\n$x &amp;&amp;= 0xFF;\r\n<\/code><\/pre>\n<p>becomes:<\/p>\n<pre><code>\r\n$x +&amp;= 0xFF;\r\n<\/code><\/pre>\n<p>The reason behind this is that now there are not only <b>numeric bitwise<\/b> operators, but also boolean ones. You can read more in the <a href=\"http:\/\/perlcabal.org\/syn\/S03.html\" rel=\"nofollow\">official specification for Perl 6 operators<\/a>.<\/p>\n<p>You can download <a href=\"http:\/\/github.com\/cosimo\/perl6-string-crc32\" rel=\"nofollow\">the code for the module on http:\/\/github.com\/cosimo\/perl6-string-crc32<\/a>. Take a look at various other Perl 6 modules on <a href=\"http:\/\/modules.perl6.org\" rel=\"nofollow\">modules.perl6.org<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A couple of days were plenty enough to whip up a new Perl 6 module, String::CRC32. This is a straight conversion from the Perl 5 CPAN version of String::CRC32. That one uses some C\/XS code though. I wrote the equivalent in Perl 6. Was quite simple actually, once I learned a bit more on numeric [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[392,395,393,394,50,290,286,391,396],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>More Perl 6 development, String::CRC32 - Random hacking<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"More Perl 6 development, String::CRC32 - Random hacking\" \/>\n<meta property=\"og:description\" content=\"A couple of days were plenty enough to whip up a new Perl 6 module, String::CRC32. This is a straight conversion from the Perl 5 CPAN version of String::CRC32. That one uses some C\/XS code though. I wrote the equivalent in Perl 6. Was quite simple actually, once I learned a bit more on numeric [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/\" \/>\n<meta property=\"og:site_name\" content=\"Random hacking\" \/>\n<meta property=\"article:published_time\" content=\"2010-08-03T18:20:28+00:00\" \/>\n<meta name=\"author\" content=\"cosimo\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"cosimo\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/\"},\"author\":{\"name\":\"cosimo\",\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1\"},\"headline\":\"More Perl 6 development, String::CRC32\",\"datePublished\":\"2010-08-03T18:20:28+00:00\",\"dateModified\":\"2010-08-03T18:20:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/\"},\"wordCount\":139,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1\"},\"keywords\":[\"and\",\"bitwise operators\",\"crc32\",\"or\",\"perl\",\"perl6\",\"rakudo\",\"string-crc32\",\"xor\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/\",\"url\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/\",\"name\":\"More Perl 6 development, String::CRC32 - Random hacking\",\"isPartOf\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#website\"},\"datePublished\":\"2010-08-03T18:20:28+00:00\",\"dateModified\":\"2010-08-03T18:20:28+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.streppone.it\/cosimo\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"More Perl 6 development, String::CRC32\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#website\",\"url\":\"https:\/\/www.streppone.it\/cosimo\/blog\/\",\"name\":\"Random hacking\",\"description\":\"Assume nothing. Code defensively. Keep it simple, stupid!\",\"publisher\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.streppone.it\/cosimo\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1\",\"name\":\"cosimo\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cb1d938720df45a2720724aae99e3bfc?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cb1d938720df45a2720724aae99e3bfc?s=96&r=g\",\"caption\":\"cosimo\"},\"logo\":{\"@id\":\"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/www.streppone.it\/cosimo\/blog\/author\/cosimo\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"More Perl 6 development, String::CRC32 - Random hacking","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/","og_locale":"en_US","og_type":"article","og_title":"More Perl 6 development, String::CRC32 - Random hacking","og_description":"A couple of days were plenty enough to whip up a new Perl 6 module, String::CRC32. This is a straight conversion from the Perl 5 CPAN version of String::CRC32. That one uses some C\/XS code though. I wrote the equivalent in Perl 6. Was quite simple actually, once I learned a bit more on numeric [&hellip;]","og_url":"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/","og_site_name":"Random hacking","article_published_time":"2010-08-03T18:20:28+00:00","author":"cosimo","twitter_card":"summary_large_image","twitter_misc":{"Written by":"cosimo","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/#article","isPartOf":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/"},"author":{"name":"cosimo","@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1"},"headline":"More Perl 6 development, String::CRC32","datePublished":"2010-08-03T18:20:28+00:00","dateModified":"2010-08-03T18:20:28+00:00","mainEntityOfPage":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/"},"wordCount":139,"commentCount":0,"publisher":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1"},"keywords":["and","bitwise operators","crc32","or","perl","perl6","rakudo","string-crc32","xor"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/","url":"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/","name":"More Perl 6 development, String::CRC32 - Random hacking","isPartOf":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#website"},"datePublished":"2010-08-03T18:20:28+00:00","dateModified":"2010-08-03T18:20:28+00:00","breadcrumb":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.streppone.it\/cosimo\/blog\/2010\/08\/more-perl-6-development-stringcrc32\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.streppone.it\/cosimo\/blog\/"},{"@type":"ListItem","position":2,"name":"More Perl 6 development, String::CRC32"}]},{"@type":"WebSite","@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#website","url":"https:\/\/www.streppone.it\/cosimo\/blog\/","name":"Random hacking","description":"Assume nothing. Code defensively. Keep it simple, stupid!","publisher":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.streppone.it\/cosimo\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/c443bedbf6ecf99550d6395620801df1","name":"cosimo","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cb1d938720df45a2720724aae99e3bfc?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cb1d938720df45a2720724aae99e3bfc?s=96&r=g","caption":"cosimo"},"logo":{"@id":"https:\/\/www.streppone.it\/cosimo\/blog\/#\/schema\/person\/image\/"},"url":"https:\/\/www.streppone.it\/cosimo\/blog\/author\/cosimo\/"}]}},"_links":{"self":[{"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/posts\/476"}],"collection":[{"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/comments?post=476"}],"version-history":[{"count":0,"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/posts\/476\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/media?parent=476"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/categories?post=476"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.streppone.it\/cosimo\/blog\/wp-json\/wp\/v2\/tags?post=476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}