@haxall/haxall
    Preparing search index...

    Class Uuid

    Universally Unique Identifier. UUIDs are 128-bit identifiers which are unique across space and time making them ideal for naming without a central naming authority. Fantom's UUIDs are loosely based on RFC 4122 with the following parts used in the generation:

    • 8 bytes: nanosecond ticks since 1 Jan 2000 UTC
    • 2 bytes: sequence number
    • 6 bytes: node address

    The sequence number is initialized from a randomized number, and helps protect against collisions when the system clock is changed. The node address is ideally mapped to the MAC address if available, or the IP address hashed with a random number.

    No guarantee is made how the bytes are laid out. Future versions might hash these bytes, or use alternate mechanisms.

    The string format for the UUID follows the canonical format of 32 hexadecimal digits displayed in five groups for "8-4-4-4-12". For example:

    03f0e2bb-8f1a-c800-e1f8-00623f7473c4
    

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    type$: Type

    Methods

    • Get the most significant 64 bits of this 128 bit UUID.

      Returns number

    • Get the least significant 64 bits of this 128 bit UUID.

      Returns number

    • Compare based on the 128 bit value which will naturally result in sorts by created timestamp.

      Parameters

      Returns number

    • Return if the specified object is a Uuid with the same 128 bits.

      Parameters

      Returns boolean

    • Hashcode is defined as bitsHi ^ bitsLow

      Returns number

    • Return if this Obj is immutable and safe to share between threads:

      • an instance of a const class
      • the result of toImmutable on List, Map, or Buf
      • a Func object may or may not be immutable - see sys::Func.
      • other instances are assumed mutable and return false

      Returns boolean

    • Get an immutable representation of this instance or throw NotImmutableErr if this object cannot be represented as an immutable:

      • if type is const, return this
      • if already an immutable List, Map, Buf, or Func return this
      • if a List, then attempt to perform a deep clone by calling toImmutable on all items
      • if a Map, then attempt to perform a deep clone by calling toImmutable on all values (keys are already immutable)
      • some Funcs can be made immutable - see sys::Func
      • if a Buf create immutable copy, see sys::Buf
      • any other object throws NotImmutableErr

      Returns Readonly<this>

    • Return the string representation of this UUID. See class header for string format.

      Returns string

    • Trap a dynamic call for handling. Dynamic calls are invoked with the -> shortcut operator:

      a->x        a.trap("x", null)
      a->x() a.trap("x", null)
      a->x = b a.trap("x", [b])
      a->x(b) a.trap("x", [b])
      a->x(b, c) a.trap("x", [b, c])

      The default implementation provided by Obj attempts to use reflection. If name maps to a method, it is invoked with the specified arguments. If name maps to a field and args.size is zero, get the field. If name maps to a field and args.size is one, set the field and return args[0]. Otherwise throw UnknownSlotErr.

      Parameters

      Returns JsObj

    • Get the Type instance which represents this object's class. Also seeType.of or Pod.of.

      Returns Type

    • This method called whenever an it-block is applied to an object. The default implementation calls the function with this, and then returns this.

      Parameters

      • f: (arg0: this) => void

      Returns this

    • Write x.toStr to standard output followed by newline. If x is null then print "null". If no argument is provided then print an empty line.

      Parameters

      Returns void

    • Parse a UUID according to the string format defined in the class header documentation. If invalid format and checked is false return null, otherwise throw ParseErr.

      Parameters

      • s: string
      • Optionalchecked: boolean
      • ...args: unknown[]

      Returns Uuid

    • Generate a new UUID globally unique in space and time.

      Parameters

      • ...args: unknown[]

      Returns Uuid

    • Create a 128-bit UUID from two 64-bit integers.

      Parameters

      • hi: number
      • lo: number

      Returns Uuid