What encoding or data type can be used to get alphanumeric string in elixir?

0 votes

I want to guess alphanumeric strings for Bitcoin mining to match leading zeros. 

For example in scala, we can use base36 binary to text encoding:- BigInt(someAlphaNumString, 36) and increment it by adding BigInt(1, 36) to our string.

What is the better way to do same in elixir?

Aug 31, 2018 in Blockchain by slayer
• 29,050 points
42 views

1 answer to this question.

0 votes

Integers in Elixir are arbitrary precision integers, so there's no need for any special BigInt data type. You can convert a base-36 string to and from integer using String.to_integer/2 and Integer.to_string/2 like this:

iex(1)> a = String.to_integer("DOGBERT", 36)
29776764809
iex(2)> b = a + 1
29776764810
iex(3)> Integer.to_string(b, 36)
"DOGBERU"
answered Aug 31, 2018 by digger
• 27,630 points

Related Questions In Blockchain

0 votes
1 answer
0 votes
2 answers
0 votes
1 answer

Can a blockchain be used to verify or store a document on the blockchain?

Bitcoin is decentralized payment syatem. It was ...READ MORE

answered May 10, 2018 in Blockchain by Johnathon
• 9,070 points
37 views
+1 vote
1 answer

Can a data be altered in a blockchain without changing its hash?

Yes, it should work. The authentication practice ...READ MORE

answered Apr 7, 2018 in Blockchain by Shashank
• 10,330 points
41 views
0 votes
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured by TLS encryption in hashgraph architecture-hashgraph, ...READ MORE

answered Aug 6, 2018 in Blockchain by ariaholic
• 7,340 points
64 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
126 views
0 votes
1 answer
0 votes
1 answer

how can i convert stub.GetTxTimestamp() to type string?

You can not directly convert the timestamp ...READ MORE

answered Jul 5, 2018 in Blockchain by digger
• 27,630 points
98 views
0 votes
1 answer

How i can use nodejs to watch transactions in bitcoin network?

you can use  const Socket = require('blockchain.info/Socket'); const mySocket ...READ MORE

answered Jul 9, 2018 in Blockchain by digger
• 27,630 points
40 views