EnigmaKit 1.1.0

EnigmaKit 1.1.0

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布最后发布2019年4月
SPM支持 SPM

Joakim Gyllström 维护。



EnigmaKit 1.1.0

  • Joakim Gyllström

𝕰𝖓𝖎𝖌𝖒𝖆𝕶𝖎𝖙

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.encode("ILBDA AMTAZ")

𝕮𝖔𝖒𝖕𝖔𝖓𝖊𝖓𝖙𝖘

𝕻𝖑𝖚𝖌𝖇𝖔𝖆𝖗𝖉

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

𝕽𝖔𝖙𝖔𝖗

// III rotor. EnigmaKit comes prebuilt with rotors I-VIII
let rotor = Rotor.III
rotor.setting = 5 // Ringstellung
rotor.position = 6 // Grundstellung

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

𝕽𝖊𝖋𝖑𝖊𝖈𝖙𝖔𝖗

// EnigmaKit comes with reflectors 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(reflector: Reflector.C, rotors: [Rotor.III, Rotor.IV, Rotor.II], plugboard: Plugboard())

𝕽𝖊𝖖𝖚𝖎𝖗𝖊𝖒𝖊𝖓𝖙𝖘

不要提及战争

𝕴𝖓𝖘𝖙𝖆𝖑𝖑𝖆𝖙𝖎𝖔𝖓

EnigmaKit 通过 Swift 包管理器CocoaPods 可用。

𝕬𝖚𝖙𝖍𝖔𝖗

Joakim Gyllström, [email protected]

𝕷𝖎𝖈𝖊𝖓𝖘𝖊

EnigmaKit 采用 MIT 许可。请参阅 LICENSE 文件以获取更多信息。