Skip to content

Commit

Permalink
Improve formatting of README
Browse files Browse the repository at this point in the history
  • Loading branch information
safakgur committed Oct 19, 2024
1 parent c52c8d4 commit 3cd7830
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ There are three standard components that make up a snowflake:
This is also referred to as Machine ID or Shard ID.

3. **Sequence number** - Incremented when multiple identifiers are generated at the
same unit of time on the same instance.
same unit of time.

## Example Configurations

Expand Down Expand Up @@ -114,9 +114,9 @@ Quoting the comparison from Sonyflake's README:
* When setting up the timestamp component, consider supplying it with a `TimeProvider` as it can
help with testing. The time provider is optional and will default to `TimeProvider.System`.

### Code Samples
## Code Samples

#### Generator registration using an integer instance ID
### Generator registration using an integer instance ID

```csharp
services.AddSingleton(static serviceProvider =>
Expand All @@ -143,7 +143,7 @@ services.AddSingleton(static serviceProvider =>
});
```

#### Generator registration using a string instance ID
### Generator registration using a string instance ID

```csharp
services.AddSingleton(static serviceProvider =>
Expand Down Expand Up @@ -175,7 +175,7 @@ services.AddSingleton(static serviceProvider =>
});
```

#### Generator usage
### Generator usage

```csharp
// Assuming the generator is registered and can be injected.
Expand All @@ -194,7 +194,7 @@ public class FooService(SnowflakeGenerator snowflakeGen)
}
```

#### Encoder usage
### Encoder usage

```csharp
var encoder = SnowflakeEncoder.Base62; // There are base 36 and 64 encoders as well, all URI-safe.
Expand Down

0 comments on commit 3cd7830

Please sign in to comment.