def get_lock_token()

in azurefunctions-extensions-bindings-servicebus/azurefunctions/extensions/bindings/servicebus/utils.py [0:0]


def get_lock_token(message: bytes, index: int) -> str:
    # Get the lock token from the message
    lock_token_encoded = message[:index]

    # Convert the lock token to a UUID using the first 16 bytes
    lock_token_uuid = uuid.UUID(bytes=lock_token_encoded[:16])

    return lock_token_uuid