API 参考
    正在准备搜索索引...

    A class representation of the BSON UUID type.

    层级 (查看层级一览)

    索引

    构造函数

    • Create an UUID type

      参数

      • 可选input: string | Uint8Array<ArrayBufferLike> | UUID

        Can be a 32 or 36 character hex string (dashes excluded/included) or a 16 byte binary Buffer.

      返回 UUID

    属性

    buffer: Uint8Array
    position: number
    sub_type: number
    BUFFER_SIZE: 256

    Initial buffer default size

    cacheHexString: boolean
    SUBTYPE_BYTE_ARRAY: 2

    Byte Array BSON type

    SUBTYPE_COLUMN: 7

    Column BSON type

    SUBTYPE_DEFAULT: 0

    Default BSON type

    SUBTYPE_ENCRYPTED: 6

    Encrypted BSON type

    SUBTYPE_FUNCTION: 1

    Function BSON type

    SUBTYPE_MD5: 5

    MD5 BSON type

    SUBTYPE_USER_DEFINED: 128

    User BSON type

    SUBTYPE_UUID: 4

    UUID BSON type

    SUBTYPE_UUID_OLD: 3

    Deprecated UUID BSON type

    Please use SUBTYPE_UUID

    访问器

    • get _bsontype(): "Binary"

      返回 "Binary"

    • get id(): Uint8Array

      The UUID bytes

      返回 Uint8Array

    方法

    • Compares the equality of this UUID with otherID.

      参数

      • otherId: string | Uint8Array<ArrayBufferLike> | UUID

        UUID instance to compare against.

      返回 boolean

    • 返回 string

    • the length of the binary sequence

      返回 number

    • Updates this binary with byte_value.

      参数

      • byteValue: string | number | number[] | Uint8Array<ArrayBufferLike>

        a single byte we wish to write.

      返回 void

    • Reads length bytes starting at position.

      参数

      • position: number

        read from the given position in the Binary.

      • length: number

        the number of bytes to read.

      返回 BinarySequence

    • Creates a Binary instance from the current UUID.

      返回 Binary

    • Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated)

      参数

      • 可选includeDashes: boolean

        should the string exclude dash-separators.

      返回 string

    • Converts the id into its JSON string representation. A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

      返回 string

    • Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified.

      参数

      • 可选encoding: "base64" | "hex"

      返回 string

    • 返回 UUID

    • Returns the value of this binary as a string.

      参数

      • 可选asRaw: boolean

        Will skip converting to a string

      返回 string | BinarySequence

      This is handy when calling this function conditionally for some key value pairs and not others

    • Writes a buffer or string to the binary.

      参数

      • sequence: string | BinarySequence

        a string or buffer to be written to the Binary BSON object.

      • offset: number

        specify the binary of where to write the content.

      返回 void

    • Creates an UUID from a base64 string representation of an UUID.

      参数

      • base64: string

      返回 UUID

    • Creates an UUID from a hex string representation of an UUID.

      参数

      • hexString: string

        32 or 36 character hex string (dashes excluded/included).

      返回 UUID

    • Generates a populated buffer containing a v4 uuid

      返回 Uint8Array

    • Checks if a value is a valid bson UUID

      参数

      • input: string | Uint8Array<ArrayBufferLike> | UUID

        UUID, string or Buffer to validate.

      返回 boolean