@jeffreyblattman/

Base64Cropped

Java

No description

fork
loading
Files
  • Main.java
  • Ids.java

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.6156803844611225","path":"Main.java","file":{"path":"Main.java","content":{"asEncoding":{"base64":"Y2xhc3MgTWFpbiB7CiAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgU3RyaW5nIGlkID0gIjA1N1lRU0ZWVEY4MCI7CiAgICBTeXN0ZW0ub3V0LnByaW50bG4oaWQpOwogICAgU3RyaW5nIGNyb3BwZWQgPSBJZHMuYmFzZTMyVG9CYXNlNjRDcm9wcGVkKGlkLCA3KTsKICAgIFN5c3RlbS5vdXQucHJpbnRsbihjcm9wcGVkKTsKICAgIFN0cmluZyBkZWNvZGVkID0gSWRzLnNhZmVCYXNlNjR0b0Jhc2UzMihjcm9wcGVkKTsKICAgIFN5c3RlbS5vdXQucHJpbnRsbihkZWNvZGVkKTsKICB9Cn0="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
class Main {
  public static void main(String[] args) {
    String id = "057YQSFVTF80";
    System.out.println(id);
    String cropped = Ids.base32ToBase64Cropped(id, 7);
    System.out.println(cropped);
    String decoded = Ids.safeBase64toBase32(cropped);
    System.out.println(decoded);
  }
}