Class: Cript::Hidr
- Inherits:
-
Object
- Object
- Cript::Hidr
- Defined in:
- lib/cript/hidr.rb
Overview
Hidr can be used to obscure strings in other utf-8 strings. This is not encryption, and it’s not secure!
Constant Summary collapse
- CHARS =
{ ascii: ["\s","\t"], unicode: ["\u200B","\uFEFF"], orly: ["\u0CA0", "\u005F"] }
Class Method Summary collapse
Instance Method Summary collapse
- #e(o) ⇒ Object
- #h(m) ⇒ Object
-
#initialize(*o) ⇒ Hidr
constructor
A new instance of Hidr.
- #s(n) ⇒ Object
Constructor Details
Class Method Details
Instance Method Details
#e(o) ⇒ Object
33 |
# File 'lib/cript/hidr.rb', line 33 def e(o);s(h(o));end |
#h(m) ⇒ Object
31 |
# File 'lib/cript/hidr.rb', line 31 def h(m);m.unpack('b*').first.split("").map{|v|v=='0'?@o[:b0]:@o[:b1]}.join;end |
#s(n) ⇒ Object
32 |
# File 'lib/cript/hidr.rb', line 32 def s(n);[n.chars.to_a.map{|y|y==@o[:b0]?'0':'1'}.join].pack('b*');end |