<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Athul A</title>
    <description>The latest articles on DEV Community by Athul A (@athulr32).</description>
    <link>https://dev.to/athulr32</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F796217%2F74b960ad-476b-40d8-a65b-5fbf419bf5b2.png</url>
      <title>DEV Community: Athul A</title>
      <link>https://dev.to/athulr32</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/athulr32"/>
    <language>en</language>
    <item>
      <title>Generate Cryptographically-secured password using 12 words mnemonic phrase without storing your password anywhere</title>
      <dc:creator>Athul A</dc:creator>
      <pubDate>Wed, 26 Oct 2022 18:42:26 +0000</pubDate>
      <link>https://dev.to/athulr32/generate-cryptographically-secured-password-using-12-words-mnemonic-phrase-without-storing-your-password-anywhere-l6g</link>
      <guid>https://dev.to/athulr32/generate-cryptographically-secured-password-using-12-words-mnemonic-phrase-without-storing-your-password-anywhere-l6g</guid>
      <description>&lt;p&gt;Hey guys I have developed an algorithm which will generate cryptographically-secured password using 12 words mnemonic words.&lt;br&gt;
You just need to remember/Write down this 12 words to recover and to get your password for all your needs.&lt;br&gt;
Your passwords are not stored anywhere,It is generated cryptographically using random entropy.&lt;/p&gt;

&lt;p&gt;I made a website to generate your 12 words and to generate passwords with it.&lt;br&gt;
At first you need a 12 words mnemonic phrase that will be your master key. DON'T LOSE IT!!!&lt;br&gt;
And after that you need to create a password(Not the one we are generating) which you can remember to create an account, So only with this password and that 12 words you can only get your words. You can have different passwords to create multiple accounts.&lt;br&gt;
For example,&lt;br&gt;
Imagine you have created a 12 words mneomnic phrase, Let us call that as X.&lt;br&gt;
So you need to create a extra password your own and call that 'abc'&lt;br&gt;
So basically X+'abc' can generate different types of password&lt;br&gt;
At the same time you can create another password call it as 'cdf' &lt;br&gt;
X+'cdf' will lead to another different account of your own seed phrase&lt;br&gt;
So you can create any number of accounts&lt;br&gt;
You can use it for several purpose.&lt;/p&gt;

&lt;p&gt;So After entering your own password we get into generating the cryptographically secured password which can be used for your credentials&lt;br&gt;
So if you want password for google you can type google in the input box and you will get your password.&lt;br&gt;
If you want another password for google account you can type 'google1' and get that.&lt;br&gt;
You can type anything in the input box and get the password&lt;br&gt;
But you need to remember what you have typed to recover it.&lt;br&gt;
For convenience we type facebook for generating passwords for facebook.&lt;/p&gt;

&lt;p&gt;Here is the website I hosted(Please open it in PC,since I didn't add media queries)&lt;br&gt;
Link : &lt;a href="https://63597b2a9c97c814225eed2c--quiet-croquembouche-dd4b57.netlify.app/"&gt;https://63597b2a9c97c814225eed2c--quiet-croquembouche-dd4b57.netlify.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is my github code link &lt;br&gt;
Link : &lt;a href="https://github.com/Athulr32/password-gen"&gt;https://github.com/Athulr32/password-gen&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;if there is any problem with the code like any security issues let me know, And I am planning to make an extension also which will help you to automatically get passwords in the input box when you visit a website and also a mobile app.&lt;/p&gt;

&lt;p&gt;So if you guys found any security flows in my code or anything to add more let me know in the comment section.&lt;/p&gt;

&lt;p&gt;Thank You :) &lt;br&gt;
Lets meet in comment section!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>blockchain</category>
      <category>react</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Difference Between Class Based and Function Based Components in React!</title>
      <dc:creator>Athul A</dc:creator>
      <pubDate>Fri, 11 Feb 2022 07:50:40 +0000</pubDate>
      <link>https://dev.to/athulr32/difference-between-class-based-and-function-based-components-in-react-1dab</link>
      <guid>https://dev.to/athulr32/difference-between-class-based-and-function-based-components-in-react-1dab</guid>
      <description>&lt;p&gt;Class Based Components were used in react before the release of hooks which supports state changing mechanism etc in function based component. &lt;br&gt;
We also use Class Based Components nowadays but function based component is more reliable with the release of react hooks. Again it depends upon on the user which one to use.They can use both or any one.&lt;br&gt;
In Class Based Components the state is managed only using objects whereas in function based we can have different values&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Function Based Component&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const [showUsers, setShowUsers] = useState(true);

//To Update this state
//we need to call setShowUsers() function and pass the value
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In function based Component the new state will overwrite the previous state,but we can do merging by using our own logic&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Class Based Component&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; constructor(){
    super();
    this.state = {
      showUsers:true,
    };

  }

//To update this State
this.setState((prevState)=&amp;gt;{
        return {//Things to be returned}
    })

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The New State will get merged with the previous state it won't get overwritten as in function based component.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Class based component cannot use React Hooks!!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading :)&lt;br&gt;
I use function based component!!What about you?&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Created a React app for calculating PNL for crypto trading</title>
      <dc:creator>Athul A</dc:creator>
      <pubDate>Sun, 30 Jan 2022 07:22:21 +0000</pubDate>
      <link>https://dev.to/athulr32/created-a-react-app-for-calculating-pnl-for-crypto-trading-52oi</link>
      <guid>https://dev.to/athulr32/created-a-react-app-for-calculating-pnl-for-crypto-trading-52oi</guid>
      <description>&lt;p&gt;Hey guys it's my first reactjs project.&lt;br&gt;
I made a PNL calculator for crypto trading.&lt;br&gt;
You need to enter the details of your trading strategy and execute and you can see your PNL. &lt;br&gt;
As of now the trade will be randomised depends upon your winrate and the PNL is calculated.&lt;/p&gt;

&lt;p&gt;Link: &lt;a href="https://crypto-pnl.herokuapp.com/"&gt;https://crypto-pnl.herokuapp.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Github: &lt;a href="https://github.com/Athulr32/crypto-pnl-calculator"&gt;https://github.com/Athulr32/crypto-pnl-calculator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you!&lt;/p&gt;

</description>
      <category>crypto</category>
      <category>trading</category>
      <category>blockchain</category>
      <category>react</category>
    </item>
    <item>
      <title>Context Api in react</title>
      <dc:creator>Athul A</dc:creator>
      <pubDate>Wed, 19 Jan 2022 10:54:07 +0000</pubDate>
      <link>https://dev.to/athulr32/context-api-in-react-36pb</link>
      <guid>https://dev.to/athulr32/context-api-in-react-36pb</guid>
      <description>&lt;p&gt;Today I covered the context api concept in react.It is useful to pass value from one component to another component without the use of props chaining. &lt;/p&gt;

&lt;p&gt;First of all we need to create a new js file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const Context=React.createContext({
        isLoggedIn : false
});

export default Context;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we created a context with the component name Contex which is an object having our value to be passed to other component&lt;/p&gt;

&lt;p&gt;Now we need to import this to parent component (Eg:App.js),&lt;br&gt;
and we should wrap the whole return state with the imported component i.e Context&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const [isLoggedIn,setLoggedIn] = useState(false);

function loginHandler(){
 setLoggedIn(true)
}

//Value here passed is the vlaue of isLoggedIn variable it will be changed when the user logged In 
&amp;lt;Context.Provider value={{
isLoggedIn:is isloggedIn}}&amp;gt;
  //Rest of the component
&amp;lt;/Context.Provider&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;so basically when the user is loggedIn the loginHandler will be executed and isLoggedIn wil become true and it will be passed to all component &lt;/p&gt;

&lt;p&gt;To consume the passed data&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//Ctx will be an object containing our data
return (&amp;lt;Context.Consumer&amp;gt;

   {(ctx)=&amp;gt;{
  return ({ctx.isLoggedIn &amp;amp;&amp;amp; &amp;lt;Login&amp;gt;&amp;lt;/Login&amp;gt;)
}}
  &amp;lt;/Context.Consumer&amp;gt;
)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There's an alternative way of consuming the data by using useContext hooks&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const ctx = useContext(Context)
return (
 ({ctx.isLoggedIn &amp;amp;&amp;amp; &amp;lt;Login&amp;gt;&amp;lt;/Login&amp;gt;}
)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This helps us to reduce the code and avoid the use of function &lt;/p&gt;

</description>
    </item>
    <item>
      <title>useState hooks in react</title>
      <dc:creator>Athul A</dc:creator>
      <pubDate>Tue, 18 Jan 2022 13:53:30 +0000</pubDate>
      <link>https://dev.to/athulr32/usestate-hooks-in-react-7di</link>
      <guid>https://dev.to/athulr32/usestate-hooks-in-react-7di</guid>
      <description>&lt;p&gt;Hey,&lt;br&gt;
It's my first post in &lt;strong&gt;dev.to&lt;/strong&gt;, I am looking forward to learn  different types of technology and their implementations,peoples thoughts etc through this platform.&lt;br&gt;
I am currently learning &lt;strong&gt;Reactjs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Today i learned about the &lt;strong&gt;useState **hook in reactjs. It was interesting and at the same time it was much confusing but I got the concept behind it and then onwards I was able to code fastly. I also given a try to **useReducer&lt;/strong&gt; hook which is an alternative to useState hook and it should be used when a state depends upon the value of another state.It also helps to reduce the number states in the code thus we are able to reduce the code length.And it's the programmer choice to choose useState or useReducer.If the logic is not much complex then useState will be the better choice whereas in the case of complex code useReducer should be apt.&lt;/p&gt;

&lt;p&gt;Thank you!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
