File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -483,7 +483,7 @@ async function get(args) {
483
483
484
484
// src/hash.ts
485
485
init_utils ( ) ;
486
- async function hash ( args , multicode , internal = false ) {
486
+ async function hash ( args , multicode = multicodes . RAW , internal = false ) {
487
487
const [ filename ] = args ;
488
488
if ( ! filename ) {
489
489
console . error ( "please pass in a file" ) ;
Original file line number Diff line number Diff line change @@ -23,13 +23,13 @@ Deno.test({
23
23
24
24
await t . step ( 'it should create a raw CID for a json file' , async ( ) => {
25
25
const filepath = './test/assets/hello.json'
26
- const actual = await hash ( [ filepath ] , multicodes . JSON , true )
27
- const expected = 'zyop8PQypgycyyCEcQsEHoc9Z8S9bQt1CuHuRKnXrAXagVBGxQyvH '
26
+ const actual = await hash ( [ filepath ] , multicodes . RAW , true )
27
+ const expected = 'z9brRu3VWh2crTt5nDjmu8dciMkHp1LR3wmDaqEqXHK46RbuTPy3 '
28
28
assertEquals ( actual , expected )
29
29
30
30
const cid = CID . parse ( actual , base58btc . decoder )
31
- assertEquals ( cid . code , multicodes . JSON )
32
- assertEquals ( cid . byteLength , 39 )
31
+ assertEquals ( cid . code , multicodes . RAW )
32
+ assertEquals ( cid . byteLength , 38 )
33
33
assertEquals ( cid . multihash . code , 45600 )
34
34
assertEquals ( cid . version , 1 )
35
35
} )
You can’t perform that action at this time.
0 commit comments