getCid()

Syntax

getCid(file: File, exportedKey?: string)

This method used to get cidFile and cidTorrentFile

Parameters

Name
Type
Required
Description

file

File

Yes

File upload

exportedKey

string

No

Require if file encrypted

Example

import {getCid} from "@eueno/lib-browser";

const getData = async () => {
   const file = files[0];
   const exportedKey = "4R2Bw-kz9DnWA5FEcoopIsPhZZ5PswLBvtPwll6ejkU"
   
   const response = await getCid(file, exportedKey);
    
    console.log(response);
 };

Response of example:

Last updated