Giter Club home page Giter Club logo

enigmakit's Introduction

๐•ฐ๐–“๐–Ž๐–Œ๐–’๐–†๐•ถ๐–Ž๐–™

CI Status Version License Platform Alt text

๐–€๐–˜๐–†๐–Œ๐–Š

// Will create an Enigma with an empty plugboard, rotors I, II, III and reflector B (wide).
let enigma = Enigma()
// Will output "ILBDA AMTAZ"
let result = enigma.encode("HELLO WORLD")
let enigma = Enigma()
// "HELLO WORLD"
let result = enigma.decode("ILBDA AMTAZ")

To run the example project, clone the repo, and run pod install from the Example directory first.

๐•ฎ๐–”๐–’๐–•๐–”๐–“๐–Š๐–“๐–™๐–˜

๐•ป๐–‘๐–š๐–Œ๐–‡๐–”๐–†๐–—๐–‰

// Create a plugboard and add a patch between A and D
let plugboard = Plugboard()
plugboard.addPatch(("A", "D"))

๐•ฝ๐–”๐–™๐–”๐–—

// III rotor. EnigmaKit comes prebuilt with rotors I-VIII
let rotor = Rotor.III
rotor.setting = 5 // Internal ring position
rotor.position = 6 // Outer ring position

// Or initialize your own
let rotor = Rotor(name: "My custom rotor", wiring: "VZBRGITYUPSDNHLXAWMJQOFECK", notch: "QV")

๐•ฝ๐–Š๐–‹๐–‘๐–Š๐–ˆ๐–™๐–”๐–—

// EnigmaKit comes with reflector A-C (wide) and B-C (thin)
let reflector = Reflector.B

// Or you can create your own reflector
let reflector = Reflector(name: "My custom reflector", wiring: "VZBRGITYUPSDNHLXAWMJQOFECK")

๐•ฐ๐–“๐–Ž๐–Œ๐–’๐–†

// Create an enigma with your own plugboard, rotors and reflector of choice
let enigma = Enigma(plugboard: Plugboard(), rotors: [Rotor.III, Rotor.IV, Rotor.II], reflector: Reflector.C)

๐•ฝ๐–Š๐––๐–š๐–Ž๐–—๐–Š๐–’๐–Š๐–“๐–™๐–˜

Don't mention the war

๐•ด๐–“๐–˜๐–™๐–†๐–‘๐–‘๐–†๐–™๐–Ž๐–”๐–“

EnigmaKit is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "EnigmaKit"

๐•ฌ๐–š๐–™๐–๐–”๐–—

Joakim Gyllstrรถm, [email protected]

๐•ท๐–Ž๐–ˆ๐–Š๐–“๐–˜๐–Š

EnigmaKit is available under the MIT license. See the LICENSE file for more info.

enigmakit's People

Contributors

mikaoj avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.