## The Luhn Algorithm

Created by the german IBM scientist Hans Peter Luhn, the Luhn Algorithm is a checksum formula being used to validate a variety of identification numbers, such as credit card numbers, IMEI numbers etc.

In this blog post, I will show you some functions I created that uses this algorithm. It can be used to calculate a checksum digit from a number, as well as validate numbers using the Luhn Algorithm checksum validation.

## Remove-Characters

This little function lets you remove characters from a string. The twist is that it takes a character array, and will remove all characters in it from the input string. (more…)

## Measure-Frequency

This one should appeal to both the statistically inclined of you, as well as those interested in cryptography. Measure-Frequency will take any array (or string) and give you the frequency distribution of it’s contents. (more…)

## Show-BinaryFile – A hex viewer in PowerShell

In my previous post I showed you a couple of wrapper functions I made to handle binary to string conversion (and vice versa). Building on one of these I thought it would be fun to try to make a simple file hex viewer, similar to how popular hex editors work (without the editing part of course). (more…)

## Binary/String conversion using Win32 API

I recently came across the Matasano Crypto Challenges, which is a set of challenges you can go through to learn more about cryptography.

While looking around for tips online for the first challenge, I stumbled upon an excellent blog article by Vadims Podāns, where he shows how, by using the Win32 native functions CryptStringToBinary and CryptBinaryToString, you can easily convert between binary and string in PowerShell. (more…)

## Invoke-WinMerge

Doing file compares can be quite confusing using Compare-Object, so unless you only want to check for equality, using a GUI can be tremendously helpful. Enter WinMerge. I guess most of you have used, or are currently using, this fabulous tool. I created a simple wrapper for WinMerge so that it’s easier than ever to open file (or folder) comparison right from the PowerShell console. (more…)

## View Steam wishlists with PowerShell

With Steam having frequent sales, I find I often pop into my own, as well as my friends wishlists to plan purchases. Wouldn’t it be great to be able to list a wishlist from the PowerShell console? (more…)

## Get-RootMeanSquare

Ever needed to get the Root Mean Square of a set before? Me neither, but I went ahead and created a small function for it anyway. (more…)

## ConvertTo-UNCPath

Converting a path to UNC path doesn’t really take that many lines of code, but having recently been in a project where I needed to do this a lot, I got tired of copy-pasting the same 2-3 lines of code back and forth, and decided to create a helper function out of it. (more…)

## Change the PowerShell console size and state programmatically

Being able to change the size of the console window (or any window for that matter) are quick and easy to do using the mouse. The same for changing the window state (for example maximizing a window). But if you want to do this programmatically (for whatever reason) it’s not so simple.

I have created a small function that makes this much easier to accomplish. (more…)