# `Isin`

A securities identification number (ISO 6166), its Luhn check digit passing: `US0378331005`.

[Money and banking](types.md#money-and-banking); not ordered; since Jadpo 0.1.0.

## Make one

Build one from its text, `Isin("US0378331005")`, which checks it: text that isn't one breaks `format`.

`text.parse(raw, as: Isin)` reads one from its text; text that isn't one at all fails `malformed`, such as `US0378331004`, `us0378331005` or `US037833100`.

## Text, JSON and storage

`text.from` writes its canonical text, the one form `text.parse` reads back. JSON sends its canonical text as a string.

| Text | JSON |
|---|---|
| `US0378331005` | `"US0378331005"` |
| `GB0002634946` | `"GB0002634946"` |
| `AU0000XVGZA3` | `"AU0000XVGZA3"` |

It is stored in one column named for the field, of type `text`. `GB0002634946` is stored as `'GB0002634946'`.

## Shown to people

`text.format(value, locale:)` shows it to people in their locale.

With `locale: Locale.en_gb`:

| Value | Shown |
|---|---|
| `US0378331005` | `US0378331005` |
| `GB0002634946` | `GB0002634946` |
| `AU0000XVGZA3` | `AU0000XVGZA3` |

## Operations

It has the contract's own operations: `text.parse`, `text.from`, `text.format`, `json.read`, `json.write` and `==`. It isn't ordered, so `<` and sorting don't take it. [Every standard type meets one contract](../topics/every-standard-type-meets-one-contract.md) says how they work.
