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,370 points
801 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
• 26,740 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
504 views
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
799 views
0 votes
1 answer

Best database type to store data that will be used with a blockchain?

Storing just the hash on the blockchain ...READ MORE

answered Apr 7, 2022 in Blockchain by Aditya
• 7,680 points
1,138 views
+1 vote
1 answer

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

yes all are over TCP/IP connections secured ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,460 points
1,434 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
1,927 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,455 views
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,740 points
1,504 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
• 26,740 points
1,283 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP