Java rot13 Hash rot13(final byte b)

Here you can find the source of rot13(final byte b)

Description

rot

License

Open Source License

Declaration

public static final byte rot13(final byte b) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static final byte a = (byte) 'a';
    private static final byte z = (byte) 'z';
    private static final byte A = (byte) 'A';
    private static final byte Z = (byte) 'Z';

    public static final byte rot13(final byte b) {
        if (b >= a && b <= z) {
            final byte c = (byte) (b + 13);
            if (c > z) {
                return (byte) (a + c - z);
            }/*  ww w.ja  va2 s .c  om*/
            return c;
        } else if (b >= A && b <= Z) {
            final byte c = (byte) (b + 13);
            if (c > Z) {
                return (byte) (A + c - Z);
            }
            return c;
        }
        return b;
    }
}

Related

  1. rot13(String _input)
  2. rot13(String argInput)
  3. rot13(String input)
  4. rot13(String input)