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,310 points

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)
iex(2)> b = a + 1
iex(3)> Integer.to_string(b, 36)
answered Aug 31, 2018 by digger
• 26,720 points

Related Questions In Blockchain

0 votes
1 answer

What technologies can be used to build private blockchain technologies?

Blockchain could be private or public. There ...READ MORE

answered May 8, 2018 in Blockchain by Robbie
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,090 points
+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 8, 2018 in Blockchain by Shashank
• 10,400 points
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 aryya
• 7,440 points
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,830 points
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
• 26,720 points
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
• 26,720 points