Method: Multibases::BaseX::Table.from
- Defined in:
- lib/multibases/base_x.rb
.from(alphabet, **opts) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/multibases/base_x.rb', line 16 def self.from(alphabet, **opts) raise ArgumentError, 'Alphabet too long' if alphabet.length >= 255 alphabet = alphabet.bytes if alphabet.respond_to?(:bytes) alphabet.map!(&:ord) new(alphabet, **opts) end |