Skip to content

Instantly share code, notes, and snippets.

@gerow
Last active December 20, 2015 11:39
Show Gist options
  • Save gerow/6125426 to your computer and use it in GitHub Desktop.
Save gerow/6125426 to your computer and use it in GitHub Desktop.
Convert a hex string into a semipronouncable string of characters
#!/usr/bin/ruby
string = ARGV[0]
puts string.downcase.split("").map{|e|
case e
when "0"
"ka"
when "1"
"ta"
when "2"
"shi"
when "3"
"ha"
when "4"
"ko"
when "5"
"ma"
when "6"
"ku"
when "7"
"su"
when "8"
"so"
when "9"
"mu"
when "a"
"mo"
when "b"
"ya"
when "c"
"yu"
when "d"
"ki"
when "e"
"fu"
when "f"
"ni"
else
"INVAL"
end
}.each_slice(2).to_a.map{|e| e.join}.join(" ")
@gerow
Copy link
Author

gerow commented Jul 31, 2013

My PGP key id

26fc25946bdf8823 => shiku niyu shima muko kuya kini soso shiha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment