Skip to content

Instantly share code, notes, and snippets.

View digital-diplomat's full-sized avatar

Bryn ♫ digital-diplomat

View GitHub Profile
@digital-diplomat
digital-diplomat / HexLib.kt
Created March 8, 2023 02:13
Program to translate HEX and ASCII, rewritten in Kotlin
// Program to encode/decode hexadecimal and ASCII/Unicode
/**
* Decodes a string of hexadecimal numbers into a string of characters.
*
* @param input A string with only valid HEX numbers separated by spaces and/or commas.
*/
fun decodeHex(input: String): String {
return input
.split(Regex("(\\s|,)+")) // Split into individual values

Keybase proof

I hereby claim:

  • I am digital-diplomat on github.
  • I am d1pl0mat (https://keybase.io/d1pl0mat) on keybase.
  • I have a public key whose fingerprint is BE68 45F6 02EA 82F2 4A81 EAE6 6D56 E565 881B DA42

To claim this, I am signing this object:

@digital-diplomat
digital-diplomat / HexLib.scala
Created June 10, 2022 18:36
Scala program to translate between HEX and ASCII
// Program to encode/decode hexadecimal and ASCII/Unicode
/**
* Decodes a string of hexadecimal numbers into a string of characters.
*
* @param input A string with only valid HEX numbers separated by spaces and/or commas.
*/
def decodeHex(input: String): String = {
input
.split("(\\s|,)+") // Split into individual values