Grounds
    Preparing search index...

    Function U128

    • Creates an unsigned 128-bit integer Relish value using JavaScript BigInt.

      Use for extremely large unsigned integers not representable in 64 bits.

      Parameters

      • value: bigint

        BigInt in range 0-340282366920938463463374607431768211455

      Returns RelishU128

      RelishU128 value

      Error if value is out of range

      import { U128 } from '@grounds/core';

      const valid = U128(BigInt('340282366920938463463374607431768211455'));
      const zero = U128(0n);

      // Runtime errors:
      // U128(-1n) // Error: out of range
      // U128(BigInt('340282366920938463463374607431768211456')) // Error: out of range

      U64 for 64-bit unsigned