Class: CfmxCompat
- Inherits:
-
Object
- Object
- CfmxCompat
- Defined in:
- lib/cfmx_compat.rb,
lib/cfmx_compat/version.rb
Defined Under Namespace
Classes: Version
Constant Summary collapse
- M_MASK_A =
0x80000062
- M_MASK_B =
0x40000020
- M_MASK_C =
0x10000002
- M_ROT0_A =
0x7fffffff
- M_ROT0_B =
0x3fffffff
- M_ROT0_C =
0xfffffff
- M_ROT1_A =
0x80000000
- M_ROT1_B =
0xc0000000
- M_ROT1_C =
0xf0000000
- UNSIGNED_CHAR =
"C*"
- UU_ENCODED_STRING =
"u"
- HEX_ENCODED_STRING =
"H*"
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.decrypt(encoded, key, encoding = "uu") ⇒ Object
26 27 28 |
# File 'lib/cfmx_compat.rb', line 26 def self.decrypt(encoded, key, encoding = "uu") new.decrypt(encoded, key, encoding) end |
.encrypt(string, key, encoding = "uu") ⇒ Object
22 23 24 |
# File 'lib/cfmx_compat.rb', line 22 def self.encrypt(string, key, encoding = "uu") new.encrypt(string, key, encoding) end |
Instance Method Details
#decrypt(encoded, key, encoding = "uu") ⇒ Object
34 35 36 |
# File 'lib/cfmx_compat.rb', line 34 def decrypt(encoded, key, encoding = "uu") transform_string(decode(encoded || "", encoding), key) end |
#encrypt(string, key, encoding = "uu") ⇒ Object
30 31 32 |
# File 'lib/cfmx_compat.rb', line 30 def encrypt(string, key, encoding = "uu") encode(transform_string(string || "", key), encoding) end |