Sha256: 1f0868ee9ff7fd91b1a1b083e882818cd8f8b88ac53c5ee4977401f33fa85874
Contents?: true
Size: 515 Bytes
Versions: 2
Compression:
Stored size: 515 Bytes
Contents
# frozen_string_literal: true module StoryKey::ClassMethods def encode(...) StoryKey::Encoder.call(...) end def decode(...) StoryKey::Decoder.call(...) end def recover StoryKey::Console::Recover.call end def generate(bitsize: StoryKey::DEFAULT_BITSIZE) key = StoryKey::Generator.call(bitsize:) encoded = encode(key:, bitsize:) raise 'An error occurred!' if key != decode(story: encoded.text) [key, encoded] end end module StoryKey extend StoryKey::ClassMethods end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
story_key-0.3.0 | lib/story_key/class_methods.rb |
story_key-0.2.0 | lib/story_key/class_methods.rb |