Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
com.ongres.stringprep:stringprep
Advanced tools
Preparation of Internationalized Strings ("stringprep")
Preparation of Internationalized Strings ("stringprep")
This project implements the RFC 3454 Preparation of Internationalized Strings ("stringprep") in pure Java.
The stringprep protocol does not stand on its own; it has to be used by other protocols at precisely-defined places in those other protocols.
SASLprep
is a profile of stringprep for user names and passwords (RFC 4013).
Import Maven dependency:
<dependency>
<groupId>com.ongres.stringprep</groupId>
<artifactId>saslprep</artifactId>
<version>2.2</version>
</dependency>
Nameprep
is a Stringprep Profile for Internationalized Domain Names (IDN) (RFC 3491).
Import Maven dependency:
<dependency>
<groupId>com.ongres.stringprep</groupId>
<artifactId>nameprep</artifactId>
<version>2.2</version>
</dependency>
The normal usage is to import the dependency of the Stringprep profile to use, and lookup the provider service that contains the profile.
Import the SASLprep
dependency, this transitively imports the Stringprep
dependency.
<dependency>
<groupId>com.ongres.stringprep</groupId>
<artifactId>saslprep</artifactId>
<version>2.2</version>
</dependency>
Get the SASLprep
provider service:
Profile saslPrep = Stringprep.getProvider("SASLprep");
String prepared = saslPrep.prepareStored("I\u00ADX \u2168");
prepared.equals("IX IX"); // true
You could also (only) use the stringprep dependency to create your own profiles by implementing the Profile
interface, just override the profile()
method with the set of options.
Anonymous on-the-fly profile usage:
Profile saslPrep = () -> EnumSet.of(Option.NORMALIZE_KC, Option.MAP_TO_NOTHING);
String prepared = saslPrep.prepareStored("I\u00ADX ⑳");
prepared.equals("IX 20"); // true
Please note that when two protocols that use different profiles of stringprep interoperate, there may be conflict about what characters are and are not allowed in the final string. Thus, protocol developers should strongly consider re-using existing profiles of stringprep.
The Stringprep and profiles implementation are explicit Java modules with the names:
com.ongres.stringprep
com.ongres.saslprep
com.ongres.nameprep
If you depend on a specific profile (saslprep
or nameprep
) there is an implied readability on stringprep
, so you will only need to declare in your module-info.java
the profile module and get the service from the provider.
Example module-info.java
:
module test.app {
requires com.ongres.saslprep;
}
This project aims to provide a implementation of these algorithms. It is written in Java and provided in a modular, re-usable way, independent of other software or programs.
Current functionality includes:
Profile
interface working as the base for implementing different profiles of Stringprep.SASLprep
profile with the specific options of Stringprep.Nameprep
profile with the specific options of Stringprep.FAQs
Unknown package
We found that com.ongres.stringprep:stringprep demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.