GsId è un sistema di identificatori personalizzato progettato per offrire un’alternativa estesa agli identificatori classici di tipo GUID / UUID.
A differenza di un GUID standard basato su 128 bit, GsId si basa su un identificatore a 256 bit, rappresentato da 64 caratteri esadecimali senza trattini.
Il progetto fornisce attualmente:
- un’implementazione C# / .NET 8;
- un’implementazione PHP;
- integrazione JSON per C#;
- integrazione Symfony per PHP;
- un tipo Doctrine DBAL per PHP;
- configurazione globale tramite
GsIdOptions.
Formato compatto senza trattini.
9F2A6C1E8D4B7A90A13F9C2DE88B421091AF77CB4D6E39A2FC018AD92E7B5C64
| Proprietà | Valore |
|---|---|
| Lunghezza | 64 caratteri |
| Trattini | No |
| Uso consigliato | Database, archiviazione, indicizzazione |
Formato leggibile con 5 trattini.
9F2A6C1E8D4B7A90-A13F9C2D-E88B4210-91AF77CB-4D6E39A2-FC018AD92E7B5C64
| Proprietà | Valore |
|---|---|
| Lunghezza | 69 caratteri |
| Trattini | Sì |
| Motivo | 16-8-8-8-8-16 |
| Uso consigliato | Log, visualizzazione, API leggibili |
GsId supporta due modalità di casing:
| Modalità | Descrizione |
|---|---|
Upper |
Lettere esadecimali maiuscole |
Lower |
Lettere esadecimali minuscole |
Esempio maiuscolo:
9F2A6C1E8D4B7A90-A13F9C2D-E88B4210-91AF77CB-4D6E39A2-FC018AD92E7B5C64
Esempio minuscolo:
9f2a6c1e8d4b7a90-a13f9c2d-e88b4210-91af77cb-4d6e39a2-fc018ad92e7b5c64
La configurazione centrale è gestita tramite GsIdOptions.
| Opzione | Descrizione | Valore predefinito |
|---|---|---|
DefaultCase |
Casing predefinito | Upper |
DefaultTextFormat |
Formato testuale predefinito | D |
DefaultJsonFormat |
Formato JSON predefinito | D |
DefaultDatabaseFormat |
Formato database predefinito | N |
IsLocked |
Indica se le opzioni sono bloccate | false |
Lock |
Blocca la configurazione | false |
- l’archiviazione interna resta invariata;
- il parsing accetta sia maiuscole sia minuscole;
- i confronti non dipendono dal casing visualizzato;
ToString()usaDefaultTextFormateDefaultCase;- la serializzazione JSON usa
DefaultJsonFormateDefaultCase; - Doctrine usa
DefaultDatabaseFormateDefaultCase; - un formato o casing passato esplicitamente ha sempre priorità;
- il blocco impedisce ogni modifica successiva delle opzioni globali.
{
"GsId": {
"DefaultCase": "Lower",
"DefaultTextFormat": "N",
"DefaultJsonFormat": "D",
"DefaultDatabaseFormat": "N",
"Lock": true
}
}File associato:
csharp/src/GalacticShrine.GsId/GsIdOptionsConfiguration.cs
gsid:
default_case: Lower
default_text_format: N
default_json_format: D
default_database_format: N
lock: trueFile associati:
php/src/GsIdSymfonyOptionsConfigurator.php
php/src/Symfony/GsIdBundle.php
php/src/Symfony/DependencyInjection/Configuration.php
php/src/Symfony/DependencyInjection/GsIdExtension.php
L’archiviazione consigliata è:
CHAR(64)Con il formato:
N
Esempio:
9F2A6C1E8D4B7A90A13F9C2DE88B421091AF77CB4D6E39A2FC018AD92E7B5C64
GsId/
├─ .gitignore
├─ LICENSE.md
├─ CHANGELOG.md
├─ README.md
├─ README.en.md
├─ README.es.md
├─ README.it.md
├─ README.jp.md
├─ ARCHITECTURE.md
├─ ARCHITECTURE.en.md
├─ ARCHITECTURE.es.md
├─ ARCHITECTURE.it.md
├─ ARCHITECTURE.jp.md
├─ csharp/
│ ├─ README.md
│ ├─ examples/
│ │ └─ appsettings.gsid.json
│ ├─ src/
│ │ └─ GalacticShrine.GsId/
│ │ ├─ GalacticShrine.GsId.csproj
│ │ ├─ GsId.cs
│ │ ├─ GsIdCase.cs
│ │ ├─ GsIdConstants.cs
│ │ ├─ GsIdException.cs
│ │ ├─ GsIdFormat.cs
│ │ ├─ GsIdGenerator.cs
│ │ ├─ GsIdJsonConverter.cs
│ │ ├─ GsIdOptions.cs
│ │ ├─ GsIdOptionsConfiguration.cs
│ │ ├─ GsIdParser.cs
│ │ └─ GsIdValidator.cs
│ └─ tests/
│ └─ GalacticShrine.GsId.Tests/
│ ├─ GalacticShrine.GsId.Tests.csproj
│ └─ GsIdTests.cs
└─ php/
├─ README.md
├─ composer.json
├─ phpunit.xml
├─ config/
│ ├─ services.gsid.yaml
│ └─ packages/
│ └─ gsid.yaml
├─ src/
│ ├─ GsId.php
│ ├─ GsIdCase.php
│ ├─ GsIdConstants.php
│ ├─ GsIdDoctrineType.php
│ ├─ GsIdException.php
│ ├─ GsIdFormat.php
│ ├─ GsIdGenerator.php
│ ├─ GsIdOptions.php
│ ├─ GsIdParser.php
│ ├─ GsIdSymfonyOptionsConfigurator.php
│ ├─ GsIdSymfonyUidBridge.php
│ ├─ GsIdValidator.php
│ └─ Symfony/
│ ├─ GsIdBundle.php
│ └─ DependencyInjection/
│ ├─ Configuration.php
│ └─ GsIdExtension.php
└─ tests/
└─ GsIdTest.php
| Parte | Stato |
|---|---|
| Build C# | Validata |
| Test C# | 14 / 14 |
| PHP Composer | Validato |
| Test PHP | 23 / 23 |
| Assert PHP | 46 |
| Configurazione Symfony | Preparata |
| Doctrine DBAL | Preparato |
GsId 1.0.0 : validato
C# : validato
PHP : validato
Test : validati
Docs : strutturate
GsId può ora essere considerato una base stabile di sviluppo per i progetti ⋞Galactic-Shrine⋟.