{"id":61533,"date":"2022-04-09T09:20:32","date_gmt":"2022-04-09T07:20:32","guid":{"rendered":"https:\/\/drafts.code-maze.com\/?p=61533"},"modified":"2022-04-09T09:20:32","modified_gmt":"2022-04-09T07:20:32","slug":"csharp-random-class","status":"publish","type":"post","link":"https:\/\/code-maze.com\/csharp-random-class\/","title":{"rendered":"Random Class in C#"},"content":{"rendered":"<p>You might be wondering why would we need the Random Class in C#? One obvious example that comes to mind would be computer games. Whether attempting to simulate the rolling of dice or mimicking a random event, getting the same result every time would clearly not be fun.<\/p>\n<p>Perhaps a more serious example would be in the world of cryptography, which requires random number generation for encryption algorithms. Even simple applications, such as randomly selecting a person from a database to be a juror, require the use of generating a random result.<\/p>\n<p>As such, we are going to explore throughout this article how to use the Random Class in C# to generate these random results.<\/p>\n<div style=\"padding: 20px; border-left: 5px #dc2323 solid; display: block; margin-bottom: 20px; box-shadow: 1px 1px 5px 0px lightgrey;\">To download the source code for this article, you can visit our <a href=\"https:\/\/github.com\/CodeMazeBlog\/CodeMazeGuides\/tree\/main\/numbers-csharp\/GenerateRandom\" target=\"_blank\" rel=\"nofollow noopener\">GitHub repository<\/a>.<\/div>\n<p>Let&#8217;s start.<\/p>\n<h2><a id=\"Intro\"><\/a>What Are Computer Generated Numbers?<\/h2>\n<p>When creating a random number, we have to remember that nothing involving a computer is truly random; there has to be some type of input in order to get a result. <strong>With that in mind, there are two types of random number generators:\u00a0 pseudorandom numbers and secure random numbers.\u00a0<\/strong><\/p>\n<p>Pseudorandom numbers are generated by an algorithm. Consequently, if we were to provide the same input every time, we would get the same number of results.\u00a0<\/p>\n<p>Secure random numbers are generated by gathering some sort of outside data that is constantly changing. For example, a secure random number would be generated by using the current CPU fan speed of the PC&#8217;s motherboard in correlation with an algorithm.<\/p>\n<p>Neither of these methods is incorrect. We must just be aware of our use case and what is an appropriate solution for the current situation. For instance, we would not want to use a pseudorandom number algorithm to generate encryption keys that hackers could guess and exploit.<\/p>\n<p>For the purpose of this article, we will mainly be using C#&#8217;s built-in pseudorandom <code>Random<\/code> class to generate random data.<\/p>\n<h2><a id=\"RandomClass\"><\/a>How to Use Random Class in C#?<\/h2>\n<p>C# makes creating a Random number very straightforward with a simple initializing of the <code>Random<\/code> class followed by the <code>.Next()<\/code> method:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">var random = new Random();\r\nvar rNum = random.Next();<\/pre>\n<p>For a more in-depth look at generating Random integers in C# see this <a href=\"https:\/\/code-maze.com\/csharp-generate-random-numbers-range\" target=\"_blank\" rel=\"noopener\">article<\/a>.<\/p>\n<p>Accordingly, we can use similar syntax to generate Random doubles:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">var random = new Random();\r\nvar rDouble = random.NextDouble();<\/pre>\n<p>For even more specifics regarding generating Random double numbers in C# take a look at this <a href=\"https:\/\/code-maze.com\/csharp-random-double-range\/\" target=\"_blank\" rel=\"noopener\">article<\/a>.<\/p>\n<h2><a id=\"ThreadSafe\"><\/a>How to Generate Thread-Safe Random Numbers?<\/h2>\n<p>The previous examples work well when we need to generate random numbers; however, what should we do when we need a parallel solution? If we attempt to use the same <code>Random<\/code> class instance across multiple threads, at the very least, we would encounter the same number always returned, and at the worst, crash our program with race conditions.<\/p>\n<p>Thankfully, version 6 of .NET provides a <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.random.shared?view=net-6.0\" target=\"_blank\" rel=\"nofollow noopener\">Random.Shared<\/a> static property that allows for a thread-safe implementation avoiding the need for us to implement our own locking mechanism:<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">var random = Random.Shared.Next();<\/code><\/p>\n<p>Because the <code>Random.Shared.Next()<\/code> is a static method, we do not need to initialize the Random class before accessing it.<\/p>\n<h2><a id=\"Strings\"><\/a>How to Generate Random Strings?<\/h2>\n<p>Generating a random string involves using the <code>Random<\/code> class&#8217;s <code>Next()<\/code> method within a loop to choose the characters within the string.<\/p>\n<p>So, let&#8217;s see that with an example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">const string alphabet = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\r\nvar random = new Random();\r\nvar pseudoRandomChars = new char[stringLength];<\/pre>\n<p>We begin by declaring a string that contains the list of characters we wish to choose from (we can also include numbers and symbols). Next, we initialize a new instance of the Random class. After which, we create a new character array with the desired length of the random string.<\/p>\n<p>Next, we follow with a <code>for<\/code> loop that populates every character in the array with a random character:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">for (int i = 0; i &lt; stringLength; ++i)\r\n{\r\n    int charIndex = random.Next(alphabet.Length);\r\n    pseudoRandomChars[i] = alphabet[charIndex];\r\n}\r\n\r\nvar pseudoRandomString = new string(pseudoRandomChars);<\/pre>\n<p>Once the loop is finished, we create a new string with the pseudo-randomly generated character array.<\/p>\n<h2><a id=\"Algorithm\"><\/a>Using Our Own Algorithm to Generate Random Data<\/h2>\n<p>There are times when we wish to generate random data in a particular way that is not confined to the current <code>Random<\/code> class algorithm. We can change this with inheritance by overriding <code>Random<\/code> class&#8217;s <code>Sample<\/code> method, which contains the algorithm to generate the random data:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">public class RandomCustom : Random\r\n{\r\n    protected override double Sample()\r\n    {\r\n        return ModifySample(base.Sample());\r\n    }\r\n\r\n    private double ModifySample(double sample)\r\n    {\r\n        double newSample = Math.Log(sample);\r\n        return newSample;\r\n    }\r\n\r\n    public override int Next()\r\n    {\r\n        return (int)(Sample() * int.MaxValue);\r\n    }\r\n}<\/pre>\n<p>Notice here, that we are just taking whatever the base sample value is and modifying it with a mathematical operation.<\/p>\n<p>Then to use this overridden method, we are going to initialize the <code>RandomCustom<\/code> class and call <code>Next()<\/code>:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">var rc = new RandomCustom();\r\nvar customAlgorithmPsuedoRandomNumber = rc.Next();<\/pre>\n<h2><a id=\"ReallyRandom\"><\/a>Is Random Class Really Random?<\/h2>\n<p><code>Random<\/code> is a pseudo-random number generator. As a result, the numbers generated are not truly random, and someone can guess these numbers with enough time and effort. Accordingly, if you wish to generate cryptographically secure random data, you will need to use C#&#8217;s <code>RandomNumberGenerator<\/code> class.<\/p>\n<p><code>RandomNumberGenerator<\/code> contains methods, with some slight parameter variation, that we can call in a very similar way as with the <code>Random<\/code> class.<\/p>\n<p>If you wish to learn more about how to specifically generate cryptographically secure integers or doubles, please follow the article links mentioned <a href=\"#RandomClass\">above<\/a>.<\/p>\n<h2>Conclusion<\/h2>\n<p>In conclusion, the two main ways to generate random numbers in C# are using the <code>Random<\/code> and <code>RandomNumberGenerator<\/code> classes. These pseudo-random and secure random generators provide the flexibility to generate random numbers in C# in a way that best fits your current need.<\/p>\n<p>Furthermore, these classes do not restrict you to just numeric values, you can use these to generate random strings as well. The C# language provides excellent tools for us to quickly and efficiently generate random numbers in C#.<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You might be wondering why would we need the Random Class in C#? One obvious example that comes to mind would be computer games. Whether attempting to simulate the rolling of dice or mimicking a random event, getting the same result every time would clearly not be fun. Perhaps a more serious example would be [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":62189,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[12],"tags":[973,1200,1199],"class_list":["post-61533","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-csharp","tag-random","tag-random-string","tag-thread-safe-random","et-has-post-format-content","et_post_format-et-post-format-standard"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Random Class in C# - Code Maze<\/title>\n<meta name=\"description\" content=\"How to use the Random Class in C# to generate random integers, doubles, strings, etc. with your own custom algorithm.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/code-maze.com\/csharp-random-class\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Random Class in C# - Code Maze\" \/>\n<meta property=\"og:description\" content=\"How to use the Random Class in C# to generate random integers, doubles, strings, etc. with your own custom algorithm.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/code-maze.com\/csharp-random-class\/\" \/>\n<meta property=\"og:site_name\" content=\"Code Maze\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-09T07:20:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1100\" \/>\n\t<meta property=\"og:image:height\" content=\"620\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Code Maze\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/CodeMazeBlog\" \/>\n<meta name=\"twitter:site\" content=\"@CodeMazeBlog\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Code Maze\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/code-maze.com\/csharp-random-class\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/code-maze.com\/csharp-random-class\/\"},\"author\":{\"name\":\"Code Maze\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04\"},\"headline\":\"Random Class in C#\",\"datePublished\":\"2022-04-09T07:20:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/code-maze.com\/csharp-random-class\/\"},\"wordCount\":878,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/code-maze.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/csharp-random-class\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"keywords\":[\"Random\",\"Random string\",\"Thread-Safe Random\"],\"articleSection\":[\"C#\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/code-maze.com\/csharp-random-class\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/code-maze.com\/csharp-random-class\/\",\"url\":\"https:\/\/code-maze.com\/csharp-random-class\/\",\"name\":\"Random Class in C# - Code Maze\",\"isPartOf\":{\"@id\":\"https:\/\/code-maze.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/code-maze.com\/csharp-random-class\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/csharp-random-class\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"datePublished\":\"2022-04-09T07:20:32+00:00\",\"description\":\"How to use the Random Class in C# to generate random integers, doubles, strings, etc. with your own custom algorithm.\",\"breadcrumb\":{\"@id\":\"https:\/\/code-maze.com\/csharp-random-class\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/code-maze.com\/csharp-random-class\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/csharp-random-class\/#primaryimage\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"width\":1100,\"height\":620,\"caption\":\"C# Development\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/code-maze.com\/csharp-random-class\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/code-maze.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Random Class in C#\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/code-maze.com\/#website\",\"url\":\"https:\/\/code-maze.com\/\",\"name\":\"Code Maze\",\"description\":\"Learn. Code. Succeed.\",\"publisher\":{\"@id\":\"https:\/\/code-maze.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/code-maze.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/code-maze.com\/#organization\",\"name\":\"Code Maze\",\"url\":\"https:\/\/code-maze.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png\",\"width\":3511,\"height\":3510,\"caption\":\"Code Maze\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/CodeMazeBlog\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04\",\"name\":\"Code Maze\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png\",\"caption\":\"Code Maze\"},\"description\":\"This is the standard author on the site. Most articles are published by individual authors, with their profiles, but when several authors have contributed, we publish collectively as a part of this profile.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/codemaze\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/CodeMazeBlog\"],\"url\":\"https:\/\/code-maze.com\/author\/codemazecontributor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Random Class in C# - Code Maze","description":"How to use the Random Class in C# to generate random integers, doubles, strings, etc. with your own custom algorithm.","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:\/\/code-maze.com\/csharp-random-class\/","og_locale":"en_US","og_type":"article","og_title":"Random Class in C# - Code Maze","og_description":"How to use the Random Class in C# to generate random integers, doubles, strings, etc. with your own custom algorithm.","og_url":"https:\/\/code-maze.com\/csharp-random-class\/","og_site_name":"Code Maze","article_published_time":"2022-04-09T07:20:32+00:00","og_image":[{"width":1100,"height":620,"url":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","type":"image\/png"}],"author":"Code Maze","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/CodeMazeBlog","twitter_site":"@CodeMazeBlog","twitter_misc":{"Written by":"Code Maze","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/code-maze.com\/csharp-random-class\/#article","isPartOf":{"@id":"https:\/\/code-maze.com\/csharp-random-class\/"},"author":{"name":"Code Maze","@id":"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04"},"headline":"Random Class in C#","datePublished":"2022-04-09T07:20:32+00:00","mainEntityOfPage":{"@id":"https:\/\/code-maze.com\/csharp-random-class\/"},"wordCount":878,"commentCount":0,"publisher":{"@id":"https:\/\/code-maze.com\/#organization"},"image":{"@id":"https:\/\/code-maze.com\/csharp-random-class\/#primaryimage"},"thumbnailUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","keywords":["Random","Random string","Thread-Safe Random"],"articleSection":["C#"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/code-maze.com\/csharp-random-class\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/code-maze.com\/csharp-random-class\/","url":"https:\/\/code-maze.com\/csharp-random-class\/","name":"Random Class in C# - Code Maze","isPartOf":{"@id":"https:\/\/code-maze.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/code-maze.com\/csharp-random-class\/#primaryimage"},"image":{"@id":"https:\/\/code-maze.com\/csharp-random-class\/#primaryimage"},"thumbnailUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","datePublished":"2022-04-09T07:20:32+00:00","description":"How to use the Random Class in C# to generate random integers, doubles, strings, etc. with your own custom algorithm.","breadcrumb":{"@id":"https:\/\/code-maze.com\/csharp-random-class\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/code-maze.com\/csharp-random-class\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/csharp-random-class\/#primaryimage","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","width":1100,"height":620,"caption":"C# Development"},{"@type":"BreadcrumbList","@id":"https:\/\/code-maze.com\/csharp-random-class\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/code-maze.com\/"},{"@type":"ListItem","position":2,"name":"Random Class in C#"}]},{"@type":"WebSite","@id":"https:\/\/code-maze.com\/#website","url":"https:\/\/code-maze.com\/","name":"Code Maze","description":"Learn. Code. Succeed.","publisher":{"@id":"https:\/\/code-maze.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/code-maze.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/code-maze.com\/#organization","name":"Code Maze","url":"https:\/\/code-maze.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/#\/schema\/logo\/image\/","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png","width":3511,"height":3510,"caption":"Code Maze"},"image":{"@id":"https:\/\/code-maze.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/CodeMazeBlog"]},{"@type":"Person","@id":"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04","name":"Code Maze","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/#\/schema\/person\/image\/","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png","caption":"Code Maze"},"description":"This is the standard author on the site. Most articles are published by individual authors, with their profiles, but when several authors have contributed, we publish collectively as a part of this profile.","sameAs":["https:\/\/www.linkedin.com\/company\/codemaze\/","https:\/\/x.com\/https:\/\/twitter.com\/CodeMazeBlog"],"url":"https:\/\/code-maze.com\/author\/codemazecontributor\/"}]}},"_links":{"self":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/61533","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/comments?post=61533"}],"version-history":[{"count":2,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/61533\/revisions"}],"predecessor-version":[{"id":68445,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/61533\/revisions\/68445"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/media\/62189"}],"wp:attachment":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/media?parent=61533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/categories?post=61533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/tags?post=61533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}