Skip to content

Instantly share code, notes, and snippets.

@yuitest
Forked from nullkal/decode.rb
Last active August 29, 2015 14:14
Show Gist options
  • Save yuitest/f4a8260e935d779ff940 to your computer and use it in GitHub Desktop.
Save yuitest/f4a8260e935d779ff940 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'base64'
hexagrams = "䷀䷪䷍䷡䷈䷄䷙䷊䷉䷹䷥䷵䷼䷻䷨䷒䷌䷰䷝䷶䷤䷾䷕䷣䷘䷐䷔䷲䷩䷂䷚䷗䷫䷛䷱䷟䷸䷯䷑䷭䷅䷮䷿䷧䷺䷜䷃䷆䷠䷞䷷䷽䷴䷦䷳䷎䷋䷬䷢䷏䷓䷇䷖䷁"
base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
puts Base64.decode64(gets.tr(hexagrams, base64chars))
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'base64'
hexagrams = "䷀䷪䷍䷡䷈䷄䷙䷊䷉䷹䷥䷵䷼䷻䷨䷒䷌䷰䷝䷶䷤䷾䷕䷣䷘䷐䷔䷲䷩䷂䷚䷗䷫䷛䷱䷟䷸䷯䷑䷭䷅䷮䷿䷧䷺䷜䷃䷆䷠䷞䷷䷽䷴䷦䷳䷎䷋䷬䷢䷏䷓䷇䷖䷁"
base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
puts (Base64.encode64(gets).tr(base64chars, hexagrams))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment