SHA256
Перевести вложения DM на R2 и обновить файловый API
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { t } from '../i18n/index.js';
|
||||
import { preparePublicFile, R2_MAX_FILE_BYTES } from './file-preparation-service.js';
|
||||
import { validatePublicPiecesRoot } from './public-pieces-root.js';
|
||||
import { importPkcs8Ed25519, signBase64 } from './crypto-utils.js';
|
||||
import { sha256HexFromArrayBuffer, validateSha256Hex } from './arweave-file-service.js';
|
||||
import { loadSessionMaterial } from './key-vault.js';
|
||||
@@ -232,7 +233,7 @@ async function uploadR2PublicFile({ file, login, sessionId, wsUrl, onStatus }) {
|
||||
}
|
||||
|
||||
export function publicR2Url(pr) {
|
||||
const root = String(pr || '').trim();
|
||||
if (!/^[A-Za-z0-9_-]{43}$/.test(root)) throw new Error('Некорректный Pieces Root');
|
||||
const root = String(pr || '');
|
||||
if (!validatePublicPiecesRoot(root)) throw new Error('Некорректный Pieces Root');
|
||||
return `https://files.shineup.me/${root}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user