Sha256: 70209e70a8ddcc3c20ebd180a6355f384de760e1821977d9d9e9ea86378a8620
Contents?: true
Size: 490 Bytes
Versions: 1
Compression:
Stored size: 490 Bytes
Contents
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::KeyGenerator.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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
story_key-0.5.0 | lib/story_key/class_methods.rb |