licensing update to APSL 2.0
[org.ibex.crypto.git] / src / org / ibex / crypto / Base36.java
1 // Copyright 2000-2005 the Contributors, as shown in the revision logs.
2 // Licensed under the Apache Public Source License 2.0 ("the License").
3 // You may not use this file except in compliance with the License.
4
5 package org.ibex.crypto;
6
7 public class Base36 {
8     public static String encode(long l) {
9         StringBuffer ret = new StringBuffer();
10         while (l > 0) {
11             if ((l % 36) < 10) ret.append((char)(((int)'0') + (int)(l % 36)));
12             else ret.append((char)(((int)'A') + (int)((l % 36) - 10)));
13             l /= 36;
14         }
15         return ret.toString();
16     }
17 }