Java Integer to intToBase32(int n)

Here you can find the source of intToBase32(int n)

Description

int To Base

License

Apache License

Declaration

static String intToBase32(int n) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    static final char[] BASE32_CHARS = "0123456789abcdefghijklmnopqrstuv".toCharArray();

    static String intToBase32(int n) {
        char[] buffer = new char[7];
        for (int i = 6; i >= 0; i--) {
            int x = n & 0x1f;
            buffer[i] = BASE32_CHARS[x];
            n = n >> 5;//from   w w  w.j a  va  2s .c  om
            if (n == 0) {
                return new String(buffer, i, 7 - i);
            }
        }
        return new String(buffer);
    }
}

Related

  1. intTo2UnsignedBytes(int val)
  2. intTo8HexString(int i)
  3. intToAlgebraicLoc(int loc)
  4. intToAlpha(Integer no)
  5. intToASN1(byte[] d, int idx, int val)
  6. intToBasicType(int i, Class clazz)
  7. intToBcd(int src, int len, int flag)
  8. intToBigEndian(int value, byte[] array, int index)
  9. intToBigEndianByteArray(int in)