Skip to content

可以提供stream相关的api么,如果文件比较大,直接操作buffer可能会占用太多内存,这个在技术上是否能实现 ,还是说必须操作整个文件 #40

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

Open
WormGirl opened this issue Feb 17, 2025 · 10 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@WormGirl
Copy link

No description provided.

@zurmokeeper
Copy link
Owner

zurmokeeper commented Feb 17, 2025

你的文件有多大?大概占了多少内存?是xlsx还是xls的?

@zurmokeeper zurmokeeper self-assigned this Feb 17, 2025
@WormGirl
Copy link
Author

10万条数据,stream可以实现么

@WormGirl
Copy link
Author

如果改成支持流,是不是分段加密就可以,然后再分段解密,那是不是要加段标记,这样是不是就能实现了,自定义一个transform流去分段加解密

@zurmokeeper
Copy link
Owner

10万条数据,stream可以实现么

文件的大小是多大?

@zurmokeeper
Copy link
Owner

如果改成支持流,是不是分段加密就可以,然后再分段解密,那是不是要加段标记,这样是不是就能实现了,自定义一个transform流去分段加解密

不一定能支持,得看下cfb.js 的实现,cfb 复合文件结构是 excel 的数据结构,得看下这个库是怎么划分excel的结构,如果是在这一步就需要读取整个excel 的话,那就估计用不了stream 了。如果能用,也得重新实现这个库的stream写法,或者自己写cfb 的stream 实现。

然后 excel 有很多种加密方式,可能得单独处理一下

你看下源码实现就可以大概了解了,所以才想知道你的excel,是哪种文件,xlsx 格式的还是xls得?,用的office 还是wps 加密的,不同的软件最后出来的加密方法不一样

@WormGirl
Copy link
Author

只考虑xlsx,office和wps都要支持,这两个对xlsx的加密方式还不一样么 , 文件多大无法估计,因为有多少列不是确定的,1GB也不是不可能,那cfb我简单看了下,试过只截断给前面的字节,无法解析的

@zurmokeeper
Copy link
Owner

只考虑xlsx,office和wps都要支持,这两个对xlsx的加密方式还不一样么 , 文件多大无法估计,因为有多少列不是确定的,1GB也不是不可能,那cfb我简单看了下,试过只截断给前面的字节,无法解析的

不一样,1G的文件真够大的,按照目前我的预估的话,要实现stream解析问题不少,难度也不小

@zurmokeeper
Copy link
Owner

@WormGirl 欢迎PR,我有空的时候也看下能不能实现

@zurmokeeper zurmokeeper added enhancement New feature or request question Further information is requested labels Feb 21, 2025
@WormGirl
Copy link
Author

WormGirl commented Mar 6, 2025

我看你这边还提供了一个https://github.com/zurmokeeper/excelize 内置这个加密的,这个支持stream模式给excel加密码么

@zurmokeeper
Copy link
Owner

我看你这边还提供了一个https://github.com/zurmokeeper/excelize 内置这个加密的,这个支持stream模式给excel加密码么
不支持的,还是和我上面说的一样,要重新写一套stream解密的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants