Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Generate Cryptocurrency Private Keys And Public Addresses With Golang

Over the past month or so I’ve demonstrated how to generate address information for a variety of cryptocurrency Altcoins using technologies like Node.js, Vue.js, and Angular. The thing about my previous tutorials are that they all used the JavaScript stack in some sense. What if we wanted to adventure into other technologies like Golang?

The process for generating key and address information for Bitcoin and popular Altcoins is pretty much the same. In reality, the difference is defined by the private key and public key prefix information, typically associated to a network.

We’re going to see how to generate and import private keys for a variety of cryptocurrency coins as well as their addresses using the Go programming language.

Read More

Encrypt And Decrypt Data In A Golang Application With The Crypto Packages

Being able to encrypt and decrypt data within an application is very useful for a lot of circumstances. Let’s not confuse encryption and decryption with hashing like that found in a bcrypt library, where a hash is only meant to transform data in one direction.

Not too long ago I wrote about in a previous article how to encrypt and decrypt data using Node.js. This was partially inspired by me learning how to build software wallets for cryptocurrencies and encrypting the sensitive information. However, what if we wanted to use Go instead of Node.js?

We’re going to take a look at encrypting data and then decrypting it within a Go application by using the already available crypto packages.

Read More

Scan For BLE iBeacon Devices With Golang On A Raspberry Pi Zero W

Last year I had worked on an interesting project at my day job, Couchbase, where I scanned for BLE iBeacon devices from a few Raspberry Pi IoT devices and uploaded the information to a remote server for analysis. I wrote about this experiment in an article titled, Collecting iBeacon Data with Couchbase and Raspberry Pi IoT Devices.

My first attempt at scanning and analyzing iBeacon data was done with Java and Node.js. The Raspberry Pi devices were using Java, and the data was being offloaded to a Node.js server. The problem with this is that Java is too heavy for the low spec Internet of Things (IoT) devices.

Fast forward to round two of playing with iBeacon devices and a Raspberry Pi. We’re going to see how to use Golang to scan for BLE signals and parse the data to determine if they are iBeacon.

Read More

Send Emails With Mailgun Using Golang

When building an application of any kind, there may be a need to have it send emails. For example, let’s say you’re building a script and that script needs to send a report through email when it has completed. Or another example is a web application with a form for collecting user feedback. There are many more application scenarios beyond the two listed.

Now let’s say that you don’t have your own email server for sending emails.

Sending emails without a server is easy when you use a transactional email service like the Mailgun API. Through HTTP, emails can be sent from any application and for a very affordable price. We’re going to see how to send emails using Mailgun with Golang.

Read More

Handling CORS In A Golang Web Application

If you’ve ever spent time building RESTful APIs, you’ve probably come across cross-origin resource sharing (CORS) issues at some time or another. Often clients will receive errors when trying to interact with an API from a domain or port different from the actual API. Back in the day I had written a hacky article on getting past these CORS issues by manipulating the browser settings. However, it is best to tackle these issues at the source.

We’re going to see how to change the cross-origin resource sharing configuration in a Golang web application that uses the mux package.

Read More

Alias URLS In Hugo Websites Using RewriteRule For Htaccess

As you may remember, I recently released The Polyglot Developer 2.0 which was a migration from WordPress to Hugo. Because my WordPress permalinks matched a similar format to Hugo I didn’t have to make too many changes. However, there was an issue with the category and tag taxonomies. In Hugo these were recommended to be plural, while in WordPress they were singular.

I’m currently using Apache for hosting The Polyglot Developer so I had to figure out how to redirect the previous WordPress traffic to prevent bad links which would hurt the search engine optimization (SEO) of my blog. We’re going to see how I made such redirects happen.

Read More

The Polyglot Developer Has A New Look

Back in 2014 I started The Polyglot Developer on WordPress with the intention of documenting what I learn and helping others in the process. However, back then, it was not called The Polyglot Developer, but instead Nic Raboy’s Code Blog. The blog was later rebranded in early 2016, but the look and feel stayed the same.

I am pleased to announce the new version of The Polyglot Developer and a few important things that have changed with this version 2 release.

Read More