不必了

文章 评论 浏览 29

不必了 2025-02-20 22:40:54

我不是DDD-GURU,但我有一些经验,所以我会试一试。

有界的上下文是名称所暗示的,即有限的上下文到特定领域。它具有特定定义明确的语言,专为特定任务而设计。它通常具有代表用例的取消标准化状态的聚集体。

在您的情况下,有限的上下文可能是“退还”或类似的东西,可能会根据“ sellerRefundProcess”的汇总,而实体或实体或仅根据每个用例的价值观。

撰写时,有限上下文应松散耦合。这是将复杂的域分为针对特定任务/用例的更特定域的重要原因。但是,如果您有业务规则,则必须在这些域之间共享,那么是的,毕竟它们并没有那么不同。也许您的域可能会以其他方式分割。

一种更简单的方法是与共享内核组件分享您拥有的共同规则。不是那么干净,但有时是不可避免的。

只是一些想法和想法,值得它的价值。

I'm no DDD-guru but I have some experience with it so I'll give it a shot.

A bounded context is just what the name suggests, a context which is bounded, to a specific domain. It has a specific well-defined language and is designed for specific tasks. It often have aggregates of de-normalized state representing use-cases.

A bounded context in your case may be "RefundHandling" or something like that, with aggregates for perhaps "SellerRefundProcess", and entities or just values for "Seller" etc depending on each use-case.

Bounded contexts should be loosely coupled as you write. That's a big reason for dividing a complex domains into more specific domains focusing on specific tasks/use-cases. But if you have business rules you have to share between these domains, then yes perhaps they are not so different after all. Perhaps your domain could be divided in other ways, if any.

An easier approach would be to share the common rules you have with shared kernel assembly. Not as clean but sometimes it's unavoidable.

Just some thoughts and ideas, for what it's worth.

有限上下文和共享业务逻辑(DDD)

不必了 2025-02-20 19:35:32

我是您上面链接的视频教程的作者。

对于任何阅读本文以及对Firebase Auth + Stream感兴趣的人,请参阅我们的更新的扑波指南: https://getStream.io/chat/docs/sdk/flutter/guides/guides/token_generation_with_firebase/

流现在有一个firebase扩展名,可以轻松管理繁重的举重。因此,上面的视频需要更新版本。

回答您的问题:

似乎即使未对firebase用户进行身份验证,也正在发生“ createStreamuserandgetToken”云功能。我看到您在此处的回购中为此创建了一张票: https://github.com/github.com/ /chatter/eslove/8

所以让我们在那里进一步讨论。

关于“跨异步差距”的限制问题noreferrer“> https://dart-lang.github.io/linter/lints/use_build_context_synchronase.html

I'm the author of the video tutorial you linked above.

For anyone reading this and who is interested in Firebase Auth + Stream, please see our updated Flutter guide: https://getstream.io/chat/docs/sdk/flutter/guides/token_generation_with_firebase/

Stream now has a Firebase extension to easily manage the heavy lifting for you. So the video above needs an updated version.

To answer your question:

It seems like the call to "createStreamUserAndGetToken" cloud function is happening even though the Firebase user is not authenticated. I see you created a ticket for this on the repo here: https://github.com/HayesGordon/chatter/issues/8

So let's discuss it further there.

With regards to your limiting issue for "BuildContexts across async gaps" see here: https://dart-lang.github.io/linter/lints/use_build_context_synchronously.html

flutter聊天应用程序firebase auth和getTream.io函数

不必了 2025-02-20 17:15:38

正如您的 ....“解压缩文件夹并将其存储在我桌面的下载文件夹中” ..

理想情况下,您的代码行应该是:

driver = webdriver.Chrome(r'C:\Users\username\Desktop\chromedriver.exe')

As you have ...."unzipped the folder and stored it in the downloads folder of my desktop"..

Ideally your line of code should be:

driver = webdriver.Chrome(r'C:\Users\username\Desktop\chromedriver.exe')

Chromedriver添加到路径上,但仍会收到消息:' Chromedriver_win32'可执行文件需要处于路径上

不必了 2025-02-20 17:02:44

按钮点击后重新构件将解决您的问题。
我在此处为您的类型问题做了一个示例示例:

https://codesandbox.io/s/stateupdateteTeptest-ectateUpdateTeTest-ectateUpdateTeTept-ectateUpdateTeTept- PB811E

如果您在解决方案方面遇到任何困难。请在此线程上回复。

re-rendering the components after the button click will solve your problem.
I have done one sample example for your type problem here:

https://codesandbox.io/s/stateupdatetest-pb811e

if you find any difficulties regarding the solution. Please reply on this thread.

如何在React中设置两个组件?

不必了 2025-02-20 13:06:25

从Android 12+上进行扫描结果,从Android 12+上筛选出FYI蓝牙(Ibeacon或Eddystone)。

https://bugs.chromium.org/p/chromium/issues/detail?id=1296054#c7 ,如Android 12 Bluetooth许可已被扩展到包括“ Neverforlocation>“ Neverforlocation”) /代码>标志。

Chrome包含此标志,因为Web蓝牙API不打算确定用户位置作为替代地理位置API的替代。

您可以在

FYI bluetooth beacons (iBeacon or eddystone) are filtered out from scan results on Android 12+

As noted in https://bugs.chromium.org/p/chromium/issues/detail?id=1296054#c7, as of Android 12 Bluetooth permissions have been extended to include the "neverForLocation" flag.

Chrome includes this flag because the Web Bluetooth API is not intended for determining user location as a replacement for the Geolocation API.

You can read more at https://bugs.chromium.org/p/chromium/issues/detail?id=1324831 as well.

如何通过Web蓝牙API获取Eddystone URL信标信息?

不必了 2025-02-20 10:15:33

根据 > ,通用代码无法假设访问特定于平台的API,因此,如果您的代码直接使用仅浏览器的全球范围,例如 window 文档,他们会丢弃错误。因此,常见的方法是懒洋洋地访问仅客户端的生命周期挂钩,例如已安装

实时演示

new Vue({
  el: '#app',
  data: {
    name: 'Alpha',
    browserApi: null
  },
  mounted() {
    this.browserApi = navigator
  }
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app">
  <div ref="elText" @click="browserApi.clipboard.writeText($refs.elText.innerText)">Hello {{ name }}!</div>
</div>

As per the document, Universal code cannot assume access to platform-specific APIs, so if your code directly uses browser-only globals like window or document, they will throw errors. Hence, the common approach is to lazily access them inside client-only lifecycle hooks such as mounted.

Live Demo :

new Vue({
  el: '#app',
  data: {
    name: 'Alpha',
    browserApi: null
  },
  mounted() {
    this.browserApi = navigator
  }
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app">
  <div ref="elText" @click="browserApi.clipboard.writeText($refs.elText.innerText)">Hello {{ name }}!</div>
</div>

vuejs:单击时将标签内容复制到剪贴板而不创建功能

不必了 2025-02-20 10:03:00

没有流程可以更改其父过程(或任何其他现有过程“环境)。

但是,您可以通过使用修改后的环境创建新的交互式外壳来创建一个新的环境。

您必须产生一个使用升级环境的外壳的新副本,并可以访问现有的stdin,stdout和stderr,并进行重新定性舞蹈。

您需要做一些事情,例如使用subprocess.popen运行/bin/bash -i

因此,原始的外壳运行的是Python,它运行了一个新的外壳。是的,您运行了很多过程。不,这还不错,因为原始的外壳和Python除了等待子壳完成外,还没有做任何事情,因此他们也可以干净地退出。

No process can change its parent process (or any other existing process' environment).

You can, however, create a new environment by creating a new interactive shell with the modified environment.

You have to spawn a new copy of the shell that uses the upgraded environment and has access to the existing stdin, stdout and stderr, and does its reinitialization dance.

You need to do something like use subprocess.Popen to run /bin/bash -i.

So the original shell runs Python, which runs a new shell. Yes, you have a lot of processes running. No it's not too bad because the original shell and Python aren't really doing anything except waiting for the subshell to finish so they can exit cleanly, also.

是否可以改变Python中父过程的环境?

不必了 2025-02-20 09:13:21

我刚刚通过创建自己的 WritableStream https://stackoverflow.com/709006255 /6732429 这样:

// HtmlWritable.js
import {Writable} from 'stream';

class HtmlWritable extends Writable {
    chunks = [];
    html = '';

    getHtml() {
        return this.html;
    }

    _write(chunk, encoding, callback) {
        this.chunks.push(chunk);
        callback();
    }

    _final(callback) {
        this.html = Buffer.concat(this.chunks).toString();
        callback();
    }
}

export default HtmlWritable;

并这样实现:

// server.jsx
import React from 'react';
import {renderToPipeableStream} from 'react-dom/server';
import {StaticRouter} from 'react-router-dom/server';
import {readFileSync} from 'fs';
import HtmlWritable from './HtmlWritable';

[...]
const writable = new HtmlWritable();
const stream = renderToPipeableStream(
    <StaticRouter location={req.url}> // In an express js context
        <App />
    </StaticRouter>,
    {
        onShellReady() {
            res.setHeader('Content-type', 'text/html');
            stream.pipe(writable);
        },
    }
);

writable.on('finish', () => {
    const html = writable.getHtml();
    const indexHTML = readFileSync('./src/packages/api/html/index.html')
        .replace('<div id="root"></div>', `<div id="root">${html}</div>`);
    res.send(indexHTML); // In an express js context
});
[...]

其中 data 是返回 fs.ReadFile index.html

那是我的解决方案,如果您解决的问题与众不同,请分享!

非常感谢并随时发表评论,我想知道您的意见

I've just solved it by creating my own WritableStream following https://stackoverflow.com/a/70900625/6732429 this way:

// HtmlWritable.js
import {Writable} from 'stream';

class HtmlWritable extends Writable {
    chunks = [];
    html = '';

    getHtml() {
        return this.html;
    }

    _write(chunk, encoding, callback) {
        this.chunks.push(chunk);
        callback();
    }

    _final(callback) {
        this.html = Buffer.concat(this.chunks).toString();
        callback();
    }
}

export default HtmlWritable;

and implementing it like this:

// server.jsx
import React from 'react';
import {renderToPipeableStream} from 'react-dom/server';
import {StaticRouter} from 'react-router-dom/server';
import {readFileSync} from 'fs';
import HtmlWritable from './HtmlWritable';

[...]
const writable = new HtmlWritable();
const stream = renderToPipeableStream(
    <StaticRouter location={req.url}> // In an express js context
        <App />
    </StaticRouter>,
    {
        onShellReady() {
            res.setHeader('Content-type', 'text/html');
            stream.pipe(writable);
        },
    }
);

writable.on('finish', () => {
    const html = writable.getHtml();
    const indexHTML = readFileSync('./src/packages/api/html/index.html')
        .replace('<div id="root"></div>', `<div id="root">${html}</div>`);
    res.send(indexHTML); // In an express js context
});
[...]

Where data is the return fs.readFile of index.html.

That was my solution, if you solved it different, please share!

Thank a lot and feel free to comment, I would like to know your opinion!

与自定义html相互作用SSR

不必了 2025-02-20 00:19:41

当解决方案解决/拒绝时,它将调用其成功/错误处理程序:

var promiseB = promiseA.then(function(result) {
   // do something with result
});

然后方法还返回承诺:PromiseB,将根据来自返回值的返回值解决/拒绝 Promisea 的成功/错误处理程序。

Promisea的成功/错误处理程序可以返回三个可能的值,这将影响Promiseb的结果:

  1. 返回什么都没有→PromiseB立即解决,
    未定义的未定义将传递给Promistb的成功处理程序
  2. 返回值→PromiseB立即解决,
    该值将传递给PromiseB的成功处理程序
  3. 返回承诺→解决后,PromiseB将得到解决。
    当被拒绝时,PromiseB将被拒绝。价值传递给
    当时的Promiseb的处理程序将是武装这种理解的承诺的结果

,您可以理解以下内容:

promiseB = promiseA.then(function(result) {
  return result + 1;
});

然后立即呼叫返回Promiseb。

当解决Promisea时,结果将把结果传达给Promisea的成功处理程序。

由于返回值是Promisea的结果 + 1,因此成功处理程序正在返回一个值(上面的选项2),因此PromiseB将立即解决,PromiseB的成功处理程序将通过Promisisea的结果 + 1通过。

When a promise is resolved/rejected, it will call its success/error handler:

var promiseB = promiseA.then(function(result) {
   // do something with result
});

The then method also returns a promise: promiseB, which will be resolved/rejected depending on the return value from the success/error handler from promiseA.

There are three possible values that promiseA's success/error handlers can return that will affect promiseB's outcome:

  1. Return nothing → PromiseB is resolved immediately,
    and undefined is passed to the success handler of promiseB
  2. Return a value → PromiseB is resolved immediately,
    and the value is passed to the success handler of promiseB
  3. Return a promise → When resolved, promiseB will be resolved.
    When rejected, promiseB will be rejected. The value passed to
    the promiseB's then handler will be the result of the promise

Armed with this understanding, you can make sense of the following:

promiseB = promiseA.then(function(result) {
  return result + 1;
});

The then call returns promiseB immediately.

When promiseA is resolved, it will pass the result to promiseA's success handler.

Since the return value is promiseA's result + 1, the success handler is returning a value (option 2 above), so promiseB will resolve immediately, and promiseB's success handler will be passed promiseA's result + 1.

如何获得承诺的价值?

不必了 2025-02-19 21:12:41

我遇到了这个问题,将一个旧的.NET框架项目升级到.NET 8。当我尝试修复配置管理器中的内容时,缺失了。清除 projectConfigurationPlatforms 根据Jool的答案,vs获得了足够的应对,以创建&lt; configurations&gt; 属性。自己在CSPROJ中设置此属性足以解决问题而不弄乱解决方案文件,例如OP的配置:

<Configurations>Debug;Release;Debug_VSTS;Release_VSTS</Configurations>

I encountered this problem upgrading an old .NET Framework project to .NET 8. I was missing a <Configurations> property in the main property group of the project file, and VS couldn't cope with this being missing when I tried to fix things in the Configuration Manager. After clearing ProjectConfigurationPlatforms in the solution as per jool's answer, VS gained enough cope to create the <Configurations> property. Setting this property yourself in the csproj is enough to fix the problem without messing with the solution file, e.g. for the OP's configurations:

<Configurations>Debug;Release;Debug_VSTS;Release_VSTS</Configurations>

当前解决方案包含不正确的配置映射

不必了 2025-02-19 11:58:31

假设您正在使用Create-React-App,

1-如果您想忽略整个项目。在项目的根部创建一个“ .env”文件,并将这些设置放入其中。

TSC_COMPILE_ON_ERROR=true
ESLINT_NO_DEV_ERRORS=true

2-如果您只想忽略那条线。在线上方提出了这一评论。

// @ts-ignore

Assuming you are using create-react-app,

1- If you want to ignore for whole project. Create a ".env" file in the root of the project and put inside it these settings.

TSC_COMPILE_ON_ERROR=true
ESLINT_NO_DEV_ERRORS=true

2-If you want to ignore just that line. Just above the line put this comment.

// @ts-ignore

为什么类型错误阻止UI

不必了 2025-02-19 05:01:07

描述

您可以使用try {...} catch(err){...}块来捕获代码中可能出现的任何错误或出口期间。并且您可以使用Everdersheetapp.getui()。alert()显示一个简单的警报对话框。

code.gs

function importRange(sourceID, sourceRange, destinationID, destinationRangeStart){
  try {
    // Gather Source range values
    const sourceSS = SpreadsheetApp.openById(sourceID);
    //
    // The rest of your code here
    //
    SpreadsheetApp.flush();
    SpreadsheetApp.getUi().alert("Success");
  }
  catch(err) {
    SpreadsheetApp.getUi().alert("Error: "+err);
  }
};

参考

Description

You can use a try {...} catch(err) {...} block to catch any error that may occur in your code or during exection. And you can use SpreadsheetApp.getUi().alert() to display a simple alert dialog box.

Code.gs

function importRange(sourceID, sourceRange, destinationID, destinationRangeStart){
  try {
    // Gather Source range values
    const sourceSS = SpreadsheetApp.openById(sourceID);
    //
    // The rest of your code here
    //
    SpreadsheetApp.flush();
    SpreadsheetApp.getUi().alert("Success");
  }
  catch(err) {
    SpreadsheetApp.getUi().alert("Error: "+err);
  }
};

Reference

Google脚本 - 执行后添加成功或错误消息

不必了 2025-02-18 16:51:18

我是否正确地说,在第一个代码段中,此代码最终会导致堆栈溢出,因为无限循环内部不断声明的变量?

不:

6.2.4对象的存储持续时间
...
6对于没有可变长度阵列类型的对象,其寿命从进入与之关联的块直到该块以任何方式结束 延伸。 (输入一个封闭的块或调用函数暂停,但不会结束,执行当前块。)如果递归输入块,则每次都会创建对象的新实例。对象的初始值不确定。 如果为对象指定了初始化,则每次在执行块的执行中达到声明或复合文字时都会执行。否则,每次达到声明

时,该值将不确定
7对于确实具有可变长度阵列类型的对象,其寿命从对象的声明延伸到程序执行之前,请留下声明的范围。 35)如果递归输入范围,每次都会创建一个对象的新实例。对象的初始值不确定。


35)离开包含声明的最内向块,或在声明之前跳到该块或嵌入式块中的一个点,离开声明的范围。

C 2011 Online Draft

每次通过循环, some_int some_pointer 的新实例将在循环主体的开头创建,并在其结束时被摧毁 - 无论如何,从逻辑上讲。在我使用的大多数实现中,这些项目的存储将在功能输入时分配一次,并在功能退出时发布。但是,这是一个实现细节,尽管很常见,但您不应该依靠它到处都是真实的。

如果 some_function 动态分配内存或其他在循环结束之前未被释放的资源,则可以耗尽动态内存池或其他方式,但这并不应该导致堆栈溢出。

Am I correct in saying that in the 1st code snippet, this code would eventually cause a stack overflow because of the variables continually being declared inside of the infinite loop?

No:

6.2.4 Storage durations of objects
...
6 For such an object that does not have a variable length array type, its lifetime extends from entry into the block with which it is associated until execution of that block ends in any way. (Entering an enclosed block or calling a function suspends, but does not end, execution of the current block.) If the block is entered recursively, a new instance of the object is created each time. The initial value of the object is indeterminate. If an initialization is specified for the object, it is performed each time the declaration or compound literal is reached in the execution of the block; otherwise, the value becomes indeterminate each time the declaration is reached.

7 For such an object that does have a variable length array type, its lifetime extends from the declaration of the object until execution of the program leaves the scope of the declaration.35) If the scope is entered recursively, a new instance of the object is created each time. The initial value of the object is indeterminate.


35) Leaving the innermost block containing the declaration, or jumping to a point in that block or an embedded block prior to the declaration, leaves the scope of the declaration.

C 2011 Online Draft

Each time through the loop new instances of some_int and some_pointer will be created at the beginning of the loop body and destroyed at the end of it - logically speaking, anyway. On most implementations I've used, storage for those items will be allocated once at function entry and released at function exit. However, that's an implementation detail, and while it's common you shouldn't rely on it being true everywhere.

If some_function dynamically allocates memory or some other resource that doesn't get freed before the end of the loop you could exhaust your dynamic memory pool or whatever, but it shouldn't cause a stack overflow as such.

将在C中无限循环中的可变声明导致堆栈溢出

不必了 2025-02-18 13:49:04

该结构是在RFC 8446中定义的,它是伪代码,它不会直接映射到任何类型的编程语言,因此不是C。

请参见 https://datatracker.ietf.org/doc/doc/html/rfc8446#section-3 解释了使用的模型和Vocabulary。

,所以我从未在C的类型中见过不透明的类型

不透明在这里意味着对于TLS“引擎”,内容无关紧要,它可以被视为Gibberish(随机)。对于其他部位来说,这肯定是有意义的,但对TLS毫无意义。
以规格中的句子为例:

应用程序数据消息包含对TLS不透明的数据。

因此,不透明在此级别表示“非结构化”。

因此,我相信应该有另一个结构结构密切仪如何表示该结构所包含的内容。你知道吗?

ciphersuite 出现这样的出现:

      uint8 CipherSuite[2];    /* Cryptographic suite selector */

      struct {
          ProtocolVersion legacy_version = 0x0303;    /* TLS v1.2 */
          Random random;
          opaque legacy_session_id<0..32>;
          CipherSuite cipher_suites<2..2^16-2>;
          opaque legacy_compression_methods<1..2^8-1>;
          Extension extensions<8..2^16-1>;
      } ClientHello;

in clienthello §4.1.2中定义的消息

uint8 ciphersuite [2] 表示Ciphersuite是2个项目是一个未签名的字节(UINT8)。

您可以在“ B.4。密码套件”上看到值:

              +------------------------------+-------------+
              | Description                  | Value       |
              +------------------------------+-------------+
              | TLS_AES_128_GCM_SHA256       | {0x13,0x01} |
              |                              |             |
              | TLS_AES_256_GCM_SHA384       | {0x13,0x02} |
              |                              |             |
              | TLS_CHACHA20_POLY1305_SHA256 | {0x13,0x03} |
              |                              |             |
              | TLS_AES_128_CCM_SHA256       | {0x13,0x04} |
              |                              |             |
              | TLS_AES_128_CCM_8_SHA256     | {0x13,0x05} |
              +------------------------------+-------------+

因此,TLS 1.3中的5个定义的密码套件中的每个套件都映射到2个字节,首先始终使用Value 0x13 for All 5案例。

因此

如果您真的想以低水平实现TLS 1.3,则确实需要完全阅读RFC 8446。多次。从上到下,底部到顶部。甚至有专门针对实施建议的部分。但是,只有在您想学习的情况下,要这样做,否则今天的任何语言都应该拥有一个适当的库来处理TLS 1.3的所有低级详细信息,并且您应该在代码中使用该库,而不是重新发明它。

struct Clienthello中的扩展是什么,该扩展扩展是什么扩展名&lt; 8..2^16-1&gt ;;?

稍后在文本中进行了解释:

扩展:客户要求从服务器请求扩展功能
在扩展字段中发送数据。实际的“扩展”
格式在第4.2节中定义。在TLS 1.3中,使用一定
扩展是强制性的,因为功能已进入
扩展以保持客户端与以前的兼容性
TLS的版本。服务器必须忽略未识别的扩展。

在第3节中解释的语法中,扩展扩展&lt; 8..2^16-1&gt; 是一个可变的长度向量,这意味着“扩展”字段的大小来自 8 <代码> 2^16-1 bytes,内容是类型扩展名第4.2节中其他位置定义的内容:

    struct {
        ExtensionType extension_type;
        opaque extension_data<0..2^16-1>;
    } Extension;

This structure is defined in RFC 8446 and it is pseudocode, it does not map as-is directly to any kind of programming language, so it is not C.

See https://datatracker.ietf.org/doc/html/rfc8446#section-3 that explains the model used and the vocabulary.

And so I never seen in C's types called opaque

opaque here means that for the TLS "engine", the content does not matter, it can be considered gibberish (random). It certainly makes sense for other parts, but not for TLS.
Take for example this sentence in the specification:

Application Data messages contain data that is opaque to TLS.

So opaque means "unstructured" at this level.

So I believe there should be another structure struct CipherSuite how to represent this struct what fileds this struct contains. do u know this?

cipherSuite appears like this:

      uint8 CipherSuite[2];    /* Cryptographic suite selector */

      struct {
          ProtocolVersion legacy_version = 0x0303;    /* TLS v1.2 */
          Random random;
          opaque legacy_session_id<0..32>;
          CipherSuite cipher_suites<2..2^16-2>;
          opaque legacy_compression_methods<1..2^8-1>;
          Extension extensions<8..2^16-1>;
      } ClientHello;

in ClientHello message defined in §4.1.2

uint8 CipherSuite[2] means that a ciphersuite is 2 items, each one being an unsigned byte (uint8).

You can see values at "B.4. Cipher Suites" which is:

              +------------------------------+-------------+
              | Description                  | Value       |
              +------------------------------+-------------+
              | TLS_AES_128_GCM_SHA256       | {0x13,0x01} |
              |                              |             |
              | TLS_AES_256_GCM_SHA384       | {0x13,0x02} |
              |                              |             |
              | TLS_CHACHA20_POLY1305_SHA256 | {0x13,0x03} |
              |                              |             |
              | TLS_AES_128_CCM_SHA256       | {0x13,0x04} |
              |                              |             |
              | TLS_AES_128_CCM_8_SHA256     | {0x13,0x05} |
              +------------------------------+-------------+

So each of the 5 defined cipher suite in TLS 1.3 is mapped to 2 bytes, first one always being with value 0x13 for all 5 cases.

so how many algorithms and what is the size of each of these algorithms in bytes or are there any other struct included to also represent CipherSuite?

If you really want to implement TLS 1.3 at a low level you really need to read RFC 8446 fully. Multiple times. From top to bottom and bottom to top. There are even sections specifically with advice on implementation. BUT do this only if you want to learn, otherwise any language today should already have a proper library handling all the low-level details of TLS 1.3 and you should use that library in your code, not reinvent it.

and what is Extension in struct Clienthello whats this Extension extensions<8..2^16-1>;?

It is explained later on in the text:

extensions: Clients request extended functionality from servers by
sending data in the extensions field. The actual "Extension"
format is defined in Section 4.2. In TLS 1.3, the use of certain
extensions is mandatory, as functionality has moved into
extensions to preserve ClientHello compatibility with previous
versions of TLS. Servers MUST ignore unrecognized extensions.

With the syntax explained in Section 3, Extension extensions<8..2^16-1> is a variable-length vector which means the "extensions" field has a size that is from 8 to 2^16-1 bytes, and the content is of type Extension defined elsewhere in the document in section 4.2 as such:

    struct {
        ExtensionType extension_type;
        opaque extension_data<0..2^16-1>;
    } Extension;

TLS 1.3客户端Hello结构。在Linux用户空间中支持的C中。任何人都可以说出什么结构应该是代表客户端Hello

不必了 2025-02-18 03:14:31

这里有一个随机用户的答案。
对我来说似乎很棒。
您可以回答答案,我将删除此答案。

他说:
如果我们将文件设计为支持添加,则可以添加所需的所有数据,而无需重写整个文件。


这个想法给了我一个很棒的起点。

因此,我可以在文件末尾附加越来越多的更改。
然后在文件中间过时的旧数据。
然后,如果需要,我可以稍后重复使用这些过时的数据插槽。

缺点是,当我有机会重写整个文件时,我需要清理过时的插槽。

There is an answer from a random user that has been deleted here.
It seems great to me.
You can claim your answer back and I'll delete this one.

He said:
If we design the file to be support addition then we able to add whatever data we want without needing to rewrite the whole file.


This idea gives me a very great starting point.

So I can append more and more changes at the end of the file.
Then obsolete old chunks of data in the middle of the file.
I can then reuse these obsolete data slots later if I want to.

The downside is that I need to clean up the obsolete slot when I have a chance to rewrite the whole file.

如何创建部分修改的二进制文件格式?

更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

更多

友情链接

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文