Namespace: Rotate

Rotate

Bit rotation operations.

Author:
  • <p>n1474335 [n1474335@gmail.com]</p>
License:
  • Apache-2.0
Source:
To Do:
  • Support for UTF16

Members


<static, constant> ROTATE_AMOUNT

Default Value:
  • 1
Source:

<static, constant> ROTATE_WHOLE

Source:

<static, constant> ROT13_AMOUNT

Default Value:
  • 13
Source:

<static, constant> ROT13_LOWERCASE

Default Value:
  • true
Source:

<static, constant> ROT13_UPPERCASE

Default Value:
  • true
Source:

Methods


<private, static> _rot(data, amount, algo)

Runs rotation operations across the input data.

Parameters:
Name Type Description
data byte_array
amount number
algo function

The rotation operation to carry out

Source:
Returns:
Type
byte_array

<static> run_rotr(input, args)

Rotate right operation.

Parameters:
Name Type Description
input byte_array
args Array.<Object>
Source:
Returns:
Type
byte_array

<static> run_rotl(input, args)

Rotate left operation.

Parameters:
Name Type Description
input byte_array
args Array.<Object>
Source:
Returns:
Type
byte_array

<static> run_rot13(input, args)

ROT13 operation.

Parameters:
Name Type Description
input byte_array
args Array.<Object>
Source:
Returns:
Type
byte_array

<private, static> _rotr(b)

Rotate right bitwise op.

Parameters:
Name Type Description
b byte
Source:
Returns:
Type
byte

<private, static> _rotl(b)

Rotate left bitwise op.

Parameters:
Name Type Description
b byte
Source:
Returns:
Type
byte

<private, static> _rotr_whole(data, amount)

Rotates a byte array to the right by a specific amount as a whole, so that bits are wrapped
from the end of the array to the beginning.

Parameters:
Name Type Description
data byte_array
amount number
Source:
Returns:
Type
byte_array

<private, static> _rotl_whole(data, amount)

Rotates a byte array to the left by a specific amount as a whole, so that bits are wrapped
from the beginning of the array to the end.

Parameters:
Name Type Description
data byte_array
amount number
Source:
Returns:
Type
byte_array