---
title: "Standards and Rules Category"
description: "Standards and Rules"
type: "docs"
category: "doc"
tags: []
authors: [Anonymous]
date: "2026-09-09"
last_update: "2026-09-09"
time_minutes: 1
draft: false
unlisted: false
url: "https://www.derafu.dev/docs/standards"
---

# Standards and Rules



---

## Enum Project

Yet Another List of Enumerations for PHP

# Yet Another List of Enumerations for PHP

![GitHub last commit](https://img.shields.io/github/last-commit/derafu/enum/main)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/derafu/enum)
![GitHub Issues](https://img.shields.io/github/issues-raw/derafu/enum)
![Total Downloads](https://poser.pugx.org/derafu/enum/downloads)
![Monthly Downloads](https://poser.pugx.org/derafu/enum/d/monthly)

A PHP repository for global enumerations.

## Note on Enumerations

While this package provides a basic set of enumerations for specific use cases, it is highly recommended to consider using [PrinsFrank/standards](https://github.com/PrinsFrank/standards) for more comprehensive enumeration needs. The PrinsFrank/standards package offers:

- A more extensive collection of standardized enumerations.
- Regular updates based on international standards.
- Better maintained and widely adopted in the PHP community.
- More robust validation and type-safety features.

This package (derafu/enum) should be considered primarily for very specific use cases where the more comprehensive solution might be unnecessary or when you need custom enumerations not covered by standard libraries.

## Installation

You can install the package via composer:

```bash
composer require derafu/enum
```




---

## L10n CL RUT Project

Chilean RUT library

# Chilean RUT library

![GitHub last commit](https://img.shields.io/github/last-commit/derafu/l10n-cl-rut/main)
![CI Workflow](https://github.com/derafu/l10n-cl-rut/actions/workflows/ci.yml/badge.svg?branch=main&amp;event=push)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/derafu/l10n-cl-rut)
![GitHub Issues](https://img.shields.io/github/issues-raw/derafu/l10n-cl-rut)
![Total Downloads](https://poser.pugx.org/derafu/l10n-cl-rut/downloads)
![Monthly Downloads](https://poser.pugx.org/derafu/l10n-cl-rut/d/monthly)

A PHP library for working with Chilean RUT and RUN identifiers.

## Description

The Chilean RUT (Rol Único Tributario) and RUN (Rol Único Nacional) are unique identification numbers assigned to individuals and businesses in Chile. This library provides utility functions to work with these identifiers, including:

- Validation of RUT/RUN numbers.
- Formatting with and without thousands separators.
- Calculation of verification digits.
- Parsing and handling different input formats.

## Installation

You can install the package via composer:

```bash
composer require derafu/l10n-cl-rut
```

## Usage

### Basic Examples

```php
use Derafu\L10n\Cl\Rut\Rut;

// Format a RUT.
echo Rut::format(12345678);              // Outputs: 12345678-5
echo Rut::formatFull(12345678);          // Outputs: 12.345.678-5

// Validate a RUT.
try {
    Rut::validate(&#039;12.345.678-5&#039;);       // Valid RUT.
    echo &quot;RUT is valid\n&quot;;
} catch (UnexpectedValueException $e) {
    echo &quot;RUT is invalid: &quot; . $e-&gt;getMessage() . &quot;\n&quot;;
}

// Calculate the verification digit.
$dv = Rut::calculateDv(12345678);        // Returns: &#039;5&#039;

// Convert a RUT to array [number, verification digit]
$parts = Rut::toArray(&#039;12.345.678-5&#039;);   // Returns: [12345678, &#039;5&#039;]

// Extract only the numeric part.
$number = Rut::removeDv(&#039;12.345.678-5&#039;); // Returns: 12345678

// Add verification digit to a number.
$withDv = Rut::addDv(12345678);          // Returns: &#039;123456785&#039;
```

### Validation Constraints

This library enforces some practical constraints on RUT numbers:

- The RUT number must be between 1,000,000 and 99,999,999.
- The verification digit must be a number between 0-9 or the uppercase letter &#039;K&#039;.
- The verification digit must be valid for the given RUT number.

## Method Reference

- `toArray(string $rut)`: Extracts the number and verification digit from a RUT.
- `format(string|int $rut)`: Formats a RUT as &quot;12345678-5&quot;.
- `formatFull(string|int $rut)`: Formats a RUT as &quot;12.345.678-5&quot;.
- `calculateDv(int $rut)`: Calculates the verification digit for a RUT.
- `validate(string $rut)`: Validates a RUT and throws an exception if invalid.
- `removeDv(string $rut)`: Extracts just the numeric part of a RUT.
- `addDv(int $rut)`: Adds the verification digit to a RUT number.




---

## L10n CL Enum Project

Chilean Enum Repository

# Chilean Enum Repository

![GitHub last commit](https://img.shields.io/github/last-commit/derafu/l10n-cl-enum/main)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/derafu/l10n-cl-enum)
![GitHub Issues](https://img.shields.io/github/issues-raw/derafu/l10n-cl-enum)
![Total Downloads](https://poser.pugx.org/derafu/l10n-cl-enum/downloads)
![Monthly Downloads](https://poser.pugx.org/derafu/l10n-cl-enum/d/monthly)

A PHP repository of chilean enum.

## Installation

You can install the package via composer:

```bash
composer require derafu/l10n-cl-enum
```





---
Last updated on 09/09/2026

