caesar-salad

API Docs for: v2.0.1
Show:

Password Class

Defined in: password.js:57
Module: caesar-salad

Handles password parsing for Caesar and Vigenere.

Password is a Builder with a Fluent Interface providing the following methods:

passwd := {
  new Password(passwd).to.shift(),
  new Password(passwd).to.shiftArray(),
  new Password(passwd).forDecryption.to.shift(),
  new Password(passwd).forDecryption.to.shiftArray()
}
(for all valid passwd)

Valid password formats:

new Password( 1  ).to.shift() // returns: 1
new Password('1' ).to.shift() // returns: 1
new Password('-1').to.shift() // returns: -1
new Password('b' ).to.shift() // returns: 1
new Password('bc').to.shift() // returns: 1

new Password( 1    ).to.shiftArray() // returns: [1]
new Password([1, 2]).to.shiftArray() // returns: [1, 2]
new Password('1, 2').to.shiftArray() // returns: [1, 2]
new Password('1,-2').to.shiftArray() // returns: [1, -2]
new Password('bc'  ).to.shiftArray() // returns: [1, 2]

Constructor

Password

(
  • passwd
  • [symbol]
  • [parent]
)

Defined in password.js:57

Parameters:

  • passwd Number | String | [Number]

    The password to parse.

  • [symbol] String optional

    internal argument for fluent interface

  • [parent] Password optional

    internal argument for fluent interface

Item Index