Fixed and random bases (WIP)

This commit is contained in:
ts
2018-10-09 12:18:33 +01:00
parent c2cda2faf8
commit d73906d29c
8 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
#!/usr/bin/ruby
require 'bases'
require_relative '../../../../../lib/objects/local_string_encoder.rb'
class BASE32Encoder < StringEncoder
def initialize
super
self.module_name = 'BASE32 Encoder'
self.strings_to_encode = ['test']
end
def encode(str)
byte_array = str.bytes
byte_array.each { |byte|
Bases.val(byte).in_hex.to_base(64)
}
test = Bases.val(binary).in_base(10).to_base(64)
test
end
end
BASE32Encoder.new.run

View File

View File

@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<encoder xmlns="http://www.github/cliffe/SecGen/encoder"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.github/cliffe/SecGen/encoder">
<name>BASE64 Encoder</name>
<author>Z. Cliffe Schreuders</author>
<module_license>MIT</module_license>
<description>Converts to BASE64 encoding.</description>
<type>string_encoder</type>
<type>ascii_reversible</type>
<type>alpha_reversible</type>
<platform>linux</platform>
<platform>windows</platform>
<solution>Encoded using Base64. Decoding tools available online e.g. https://www.base64decode.org/</solution>
<read_fact>strings_to_encode</read_fact>
<read_fact>base64_options</read_fact>
<output_type>encoded_strings</output_type>
</encoder>