Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add huoshan translate service #780

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

windwhim
Copy link

add huoshan translate service

add huoshan translate service
fix: fix 443, add huoshan translate service
update-beta.json Outdated Show resolved Hide resolved
package.json Outdated
@@ -35,6 +35,7 @@
"franc": "^6.1.0",
"iso639-js": "^1.1.3",
"jsencrypt": "^3.3.2",
"volcengine-sdk": "^0.0.2",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

volcengine-sdk is not actively maintained. Any reason to choose this package?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在新的提交中,我按照volcengine-sdk中的方法使用crypto-js替代了volcengine-sdk

@@ -12,6 +12,8 @@ declare const _globalThis: {
addon: typeof addon;
};

declare module "volcengine-sdk";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果不增加这一句,会导致无法找到该模块

windwhim and others added 3 commits April 11, 2024 00:19
The encryption algorithm in volcengine-sdk is implemented using crypto-js
删除了volcengine-sdk依赖
@windingwind
Copy link
Owner

整体ok,两个小建议/问题:

  1. 建议尽可能减少依赖第三方包(如crypto-js),使用browser自带的crypto对象,见utils/crypto.ts,其中有一些已有的方法。如果这部分有困难,先按照目前合并也可。
  2. crypto-js不在目前的package.json,如果依赖,需要添上。

@windwhim
Copy link
Author

整体ok,两个小建议/问题:

  1. 建议尽可能减少依赖第三方包(如crypto-js),使用browser自带的crypto对象,见utils/crypto.ts,其中有一些已有的方法。如果这部分有困难,先按照目前合并也可。
  2. crypto-js不在目前的package.json,如果依赖,需要添上。

在之后我尝试使用crypto.ts重写

add crypto-js dependencies
@windwhim
Copy link
Author

整体ok,两个小建议/问题:

  1. 建议尽可能减少依赖第三方包(如crypto-js),使用browser自带的crypto对象,见utils/crypto.ts,其中有一些已有的方法。如果这部分有困难,先按照目前合并也可。
  2. crypto-js不在目前的package.json,如果依赖,需要添上。

在使用crypto.ts时,它的hmacSha256Digest返回的为一个Promise,而crypto-js中HmacSHA256返回的是一个object,我不知道要怎样解决,所以暂时在package.json添加了crypto-js依赖

@windingwind
Copy link
Owner

在使用crypto.ts时,它的hmacSha256Digest返回的为一个Promise,而crypto-js中HmacSHA256返回的是一个object,我不知道要怎样解决,所以暂时在package.json添加了crypto-js依赖

Promise是JavaScript的原生对象,用于异步。可通过类似res = await hmacSha256Digest(...)获取

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants