summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/ayk/jcryption.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/ayk/jcryption.rb b/lib/ayk/jcryption.rb
index ab60d34..6e4d1ed 100644
--- a/lib/ayk/jcryption.rb
+++ b/lib/ayk/jcryption.rb
@@ -42,6 +42,18 @@ def Math.power_modulo(b, p, m)
end
end
#
+class Fixnum
+ def to_bytes
+ str = ''
+ int = self
+ while int!=0 do
+ int,r = int.divmod 256
+ str += r.chr
+ end
+ str
+ end
+end
+#
class Bignum
#
class << self