user124971: 
https://brainwalletx.github.io/#converter,
5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf
This private key  is generated from 1
If i do this other way on this same site, It gives me different result

I want a formula to convert This 1 into this private key(5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf) in python
Anyone knows formula or python code to do this ?

user13866: 
If i do this other way on this same site, It gives me different result

Try entering 0000000000000000000000000000000000000000000000000000000000000001 and selecting Hex at the top and Base58check at the bottom.



I want a formula to convert This 1 into this private key (5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf) in python

https://www.google.com/search?q=python+base58check leads to https://pypi.org/project/base58check/ and many others.
Note that these libraries require that your value 1 be expressed as a byte array, not as a single decimal integer.

Remember that what you are seeing is not conversion of a single number into a private key but simply the same number presented in two different representations. That is, two different encodings. Note also that encoding is not encryption.

1 is the same number as 0x01 even though the latter is encoded as hexadecimal.

1 is the same number as 5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf even though the latter is encoded as Base58check.



user76567: Using this Python library (I am the author)
>>> from cryptotools import PrivateKey
>>> i = 1
>>> prv = PrivateKey(i.to_bytes(32, ‘big’))
>>> prv.wif()
‘5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf‘


124971: <p><a href="https://i.stack.imgur.com/cBGdZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cBGdZ.png" alt="enter image description here" /></a></p>
<p><a href="https://brainwalletx.github.io/#converter" rel="nofollow noreferrer">https://brainwalletx.github.io/#converter</a>,
5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf</p>
<p>This private key  is generated from 1</p>
<p>If i do this other way on this same site, It gives me different result</p>
<p><a href="https://i.stack.imgur.com/foDqu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/foDqu.png" alt="enter image description here" /></a>
I want a formula to convert This 1 into this private key(5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf) in python
Anyone knows formula or python code to do this ?</p>
 13866: <blockquote>
<p><strong>If i do this other way on this same site, It gives me different result</strong></p>
</blockquote>
<p>Try entering <code>0000000000000000000000000000000000000000000000000000000000000001</code> and selecting <code>Hex</code> at the top and <code>Base58check</code> at the bottom.</p>
<p><a href="https://i.stack.imgur.com/CnEkp.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CnEkp.jpg" alt="brainwallet webpage" /></a></p>
<hr />
<blockquote>
<p><strong>I want a formula to convert This 1 into this private key (5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf) in python</strong></p>
</blockquote>
<p><a href="https://www.google.com/search?q=python+base58check" rel="nofollow noreferrer">https://www.google.com/search?q=python+base58check</a> leads to <a href="https://pypi.org/project/base58check/" rel="nofollow noreferrer">https://pypi.org/project/base58check/</a> and many others.</p>
<p>Note that these libraries require that your value 1 be expressed as a byte array, not as a single decimal integer.</p>
<hr />
<p>Remember that what you are seeing is not <em>conversion of a single number into a private key</em> but simply the same number presented in two different representations. That is, two different encodings. Note also that encoding is not encryption.</p>
<ul>
<li><p>1 is the same number as 0x01 even though the latter is encoded as hexadecimal.</p>
</li>
<li><p>1 is the same number as 5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf even though the latter is encoded as Base58check.</p>
</li>
</ul>
 76567: <p>Using <a href="https://github.com/mcdallas/cryptotools" rel="nofollow noreferrer">this</a> Python library (I am the author)</p>
<pre><code>&gt;&gt;&gt; from cryptotools import PrivateKey
&gt;&gt;&gt; i = 1
&gt;&gt;&gt; prv = PrivateKey(i.to_bytes(32, ‘big’))
&gt;&gt;&gt; prv.wif()
‘5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf‘
</code></pre>
