[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Type](https://evolu.dev/docs/api-reference/common/Type) › betweenBigInt

```ts
function betweenBigInt<Min extends bigint, Max extends bigint>(
  min: ValidateBrandFactoryBigInt<Min>,
  max: ValidateBrandFactoryBigInt<Max>,
): BrandFactory<`Between${Min}n-${Max}n`, bigint, BetweenBigIntError<Min, Max>>;
```

Defined in: [packages/common/src/Type.ts:12693](https://github.com/evoluhq/evolu/blob/bc4578a260dd15d5bbf94b83765ca05984d194cb/packages/common/src/Type.ts#L12693)

Bigint [Brand](https://evolu.dev/docs/api-reference/common/Brand/interfaces/Brand) requiring a value within an inclusive range.

The bigint counterpart of [between](https://evolu.dev/docs/api-reference/common/Type/functions/between); see [greaterThanBigInt](https://evolu.dev/docs/api-reference/common/Type/functions/greaterThanBigInt).

### Example

```ts
import {
  assertEqual,
  assertErr,
  assertOk,
  assertType,
  BigInt,
  betweenBigInt,
  type Brand,
} from "@evolu/common";

const SignedByte = betweenBigInt(-128n, 127n)(BigInt);

assertType<typeof SignedByte.Output, bigint & Brand<"Between-128n-127n">>();
assertOk(SignedByte.fromUnknown(-128n), -128n);
assertOk(SignedByte.fromUnknown(127n), 127n);

const tooLarge = SignedByte.fromUnknown(128n);
assertErr(tooLarge, {
  type: "Between-128n-127n",
  value: 128n,
  min: -128n,
  max: 127n,
});
assertEqual(
  SignedByte.formatError(tooLarge.error),
  "The value 128 must be between -128 and 127, inclusive.",
);
```