Base58-encoded UUID library for Java.
🌐 Try the online converter at b58uuid.io
Convert standard 36-character UUIDs to compact 22-character Base58 format:
- Significantly shorter - From 36 to 22 characters:
550e8400-e29b-41d4-a716-446655440000→BWBeN28Vb7cMEx7Ym8AUzs - URL-safe - No special characters that need escaping
- Unambiguous - Uses Bitcoin's Base58 alphabet (excludes 0, O, I, l)
- Fast - Optimized encoding/decoding algorithms
- Thread-safe - Safe for concurrent use
- Zero dependencies - Uses only Java standard library
- Java 8+ - Compatible with Java 8 and higher
<dependency>
<groupId>io.b58uuid</groupId>
<artifactId>b58uuid</artifactId>
<version>1.0.0</version>
</dependency>implementation 'io.b58uuid:b58uuid:1.0.0'import io.b58uuid.B58UUID;
public class Example {
public static void main(String[] args) throws Exception {
// Generate a new UUID
String b58 = B58UUID.generate();
System.out.println(b58); // Output: 3FfGK34vwMvVFDedyb2nkf
// Encode existing UUID
String encoded = B58UUID.encodeUUID("550e8400-e29b-41d4-a716-446655440000");
System.out.println(encoded); // Output: BWBeN28Vb7cMEx7Ym8AUzs
// Decode back to UUID
String uuid = B58UUID.decodeToUUID("BWBeN28Vb7cMEx7Ym8AUzs");
System.out.println(uuid); // Output: 550e8400-e29b-41d4-a716-446655440000
}
}generate()- Generate a new random UUID and return Base58 encodingencodeUUID(String uuidStr)- Encode UUID string to Base58decodeToUUID(String b58Str)- Decode Base58 string to UUIDencode(byte[] data)- Encode 16-byte UUID to Base58decode(String b58Str)- Decode Base58 string to 16-byte UUID
B58UUIDException- Thrown for invalid input or overflow
- Zero dependencies (uses only Java standard library)
- Always produces exactly 22 characters
- Uses Bitcoin Base58 alphabet (no 0, O, I, l)
- Thread-safe
- Full error handling
mvn test- Java 8 or higher
- Apache Maven 3.6.0 or higher
# Clone the repository
git clone https://github.com/b58uuid/b58uuid-java.git
cd b58uuid-java
# Build and run tests
mvn clean test
# Package the library
mvn packageFor detailed contribution guidelines, see CONTRIBUTING.md.
B58UUID is available in multiple languages:
- Go: b58uuid-go - Available on pkg.go.dev
- Rust: b58uuid-rs - Available on crates.io
- JavaScript/TypeScript: b58uuid-js - Available on npm
- Python: b58uuid-py - Available on PyPI
- 🌐 Online Converter - Try B58UUID in your browser
- 📚 Documentation
- 🐛 Report Issues
MIT License - see LICENSE file for details.