md5[FILE]: document that the hash includes the file extension; consider an MD5 of the content
@danchanka ci sta già lavorando.
Dal 20/10/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Description
md5[FILE] from the System module (md5(FILE file) = FORMULA STRING 'md5($1)') hashes the stored FILE value, which consists of a byte with the extension length, the extension and the content. This is consistent with FILE being "extension + bytes": two FILE values with the same bytes but different extensions are different values, and the hash works well for detecting changes of a FILE property.
However, the documentation (System, File helpers) only says "md5[FILE] — MD5 hash", while the common meaning of "MD5 of a file" is the hash of its bytes only (md5sum, certutil -hashfile, HTTP Content-MD5). Code that uses md5[FILE] to compare with a checksum provided by a sender, or to detect that the same file was received again under another extension, gets a mismatch without any hint why.
Steps to reproduce
- Create
C:/tmp/x.txtcontaining exactly three bytesabc(no newline):python -c "open('C:/tmp/x.txt','wb').write(b'abc')" - Run via
POST /eval:contentMd5 (RAWFILE f) = FORMULA STRING 'md5($1)'; run() { LOCAL f = FILE (); READ 'file://C:/tmp/x.txt' TO f; EXPORT JSON FROM ext = extension(f()), md5File = md5(f()), md5Content = contentMd5(RAWFILE(f())); }
Actual behavior
HTTP 200:
{"ext":"txt","md5File":"4d9ddfa08fbafc7488a52eb7f4d49e6c","md5Content":"900150983cd24fb0d6963f7d28e17f72"}
900150983cd24fb0d6963f7d28e17f72is the MD5 of the contentabc— the same asmd5sumorcertutil -hashfile C:\tmp\x.txt MD5.4d9ddfa08fbafc7488a52eb7f4d49e6cis the MD5 of the bytes03 74 78 74 61 62 63— extension length,txt, content. The same file namedx.csvwould give6fe3582997ecdab9beedef7c534246e5(MD5 of03 63 73 76 61 62 63).
Expected behavior
Either the documentation states that md5[FILE] hashes the FILE value (extension length + extension + content), or there is a documented way to get the MD5 of the content only, matching md5sum/certutil (today it works via a custom formula over RAWFILE).
Where in the source
system/System.lsf:339 — md5(FILE file) = FORMULA STRING 'md5($1)';: PostgreSQL hashes the stored FILE value, which is built in FileData.getBytes() (api module, lsfusion/base/file/FileData.java, lines 54–58): extension length byte, extension, content.
Request
- Document in System (File helpers) that
md5[FILE]hashes the FILE value including the extension, and point toRAWFILEfor a content hash. - Optionally add a ready-made content hash (e.g.
md5[RAWFILE]), so that a customFORMULAis not needed.
Impact
Content-based checks ("this file has already been imported", comparison with a sender's checksum) silently fail if they use md5[FILE]: the same bytes with another extension give another hash, and the hash never matches external tools.
- Lingua principale
- Java
- Stelle
- 214
- Fork
- 46
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di lsfusion/platform
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
Tutte le issue di lsfusion/platform
Issue simili
-
Quick Installation step 2 installs from the plugin manager, but the plugin isn't published yetAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
I maintainer di solito rispondono entro 6 giorni
-
account assessment course feature lecture
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] 连接达梦时报错,agent 进程启动即退Apertabug db/dameng user-priority/P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
app:learninggoalhub enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno