File tree 3 files changed +7
-7
lines changed
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ This will make sure that dependencies are rewritten to known working versions.
67
67
68
68
``` go
69
69
// Create a cid from a marshaled string
70
- c , err := cid.Decode (" zdvgqEMYmNeH5fKciougvQcfzMcNjF3Z1tPouJ8C7pc3pe63k " )
70
+ c , err := cid.Decode (" bafzbeigai3eoy2ccc7ybwjfz5r3rdxqrinwi4rwytly24tdbh6yk7zslrm " )
71
71
if err != nil {...}
72
72
73
73
fmt.Println (" Got CID: " , c)
Original file line number Diff line number Diff line change @@ -368,7 +368,7 @@ func (c Cid) String() string {
368
368
case 0 :
369
369
return c .Hash ().B58String ()
370
370
case 1 :
371
- mbstr , err := mbase .Encode (mbase .Base58BTC , c .Bytes ())
371
+ mbstr , err := mbase .Encode (mbase .Base32 , c .Bytes ())
372
372
if err != nil {
373
373
panic ("should not error with hardcoded mbase: " + err .Error ())
374
374
}
Original file line number Diff line number Diff line change @@ -438,25 +438,25 @@ func TestHexDecode(t *testing.T) {
438
438
t .Fatal (err )
439
439
}
440
440
441
- if c .String () != "zb2rhhFAEMepUBbGyP1k8tGfz7BSciKXP6GHuUeUsJBaK6cqG " {
441
+ if c .String () != "bafkreie5qrjvaw64n4tjm6hbnm7fnqvcssfed4whsjqxzslbd3jwhsk3mm " {
442
442
t .Fatal ("hash value failed to round trip decoding from hex" )
443
443
}
444
444
}
445
445
446
446
func ExampleDecode () {
447
- encoded := "zb2rhhFAEMepUBbGyP1k8tGfz7BSciKXP6GHuUeUsJBaK6cqG "
447
+ encoded := "bafkreie5qrjvaw64n4tjm6hbnm7fnqvcssfed4whsjqxzslbd3jwhsk3mm "
448
448
c , err := Decode (encoded )
449
449
if err != nil {
450
450
fmt .Printf ("Error: %s" , err )
451
451
return
452
452
}
453
453
454
454
fmt .Println (c )
455
- // Output: zb2rhhFAEMepUBbGyP1k8tGfz7BSciKXP6GHuUeUsJBaK6cqG
455
+ // Output: bafkreie5qrjvaw64n4tjm6hbnm7fnqvcssfed4whsjqxzslbd3jwhsk3mm
456
456
}
457
457
458
458
func TestFromJson (t * testing.T ) {
459
- cval := "zb2rhhFAEMepUBbGyP1k8tGfz7BSciKXP6GHuUeUsJBaK6cqG "
459
+ cval := "bafkreie5qrjvaw64n4tjm6hbnm7fnqvcssfed4whsjqxzslbd3jwhsk3mm "
460
460
jsoncid := []byte (`{"/":"` + cval + `"}` )
461
461
var c Cid
462
462
err := json .Unmarshal (jsoncid , & c )
@@ -470,7 +470,7 @@ func TestFromJson(t *testing.T) {
470
470
}
471
471
472
472
func TestJsonRoundTrip (t * testing.T ) {
473
- exp , err := Decode ("zb2rhhFAEMepUBbGyP1k8tGfz7BSciKXP6GHuUeUsJBaK6cqG " )
473
+ exp , err := Decode ("bafkreie5qrjvaw64n4tjm6hbnm7fnqvcssfed4whsjqxzslbd3jwhsk3mm " )
474
474
if err != nil {
475
475
t .Fatal (err )
476
476
}
You can’t perform that action at this time.
0 commit comments