You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
898 B

  1. BEGIN { if (-e $ENV{SITE}.'/lib') { use lib $ENV{SITE}.'/lib'; } }
  2. use seed qw(getsalt);
  3. seed::setseed(0x1245356);
  4. use encode qw(decode_base58f encode_base58f);
  5. use CAStore qw(cashash CASWrite);
  6. printf "v16: %s\n",unpack'H*',decode_base58f('TxG4cMYVXUM4T8GdwCyauYe4UkKYWnrkFsZVxe3KRfg');
  7. printf "v58: %s\n",encode_base58f(pack'H*','0d347435dc89c141487f8ec816d71bdc05341b52f40b53fb6bd8469885bcee57');
  8. printf "v58: %s\n",encode_base58f(pack'H*','0d34000000000000000000000000000000000000000000000000000000000000');
  9. printf "len: %d\n",length('TxG4cMYVXUM4T8GdwCyauYe4UkKYWnrkFsZVxe3KRfg');
  10. my $type = 'Txi';
  11. my $salt = &getsalt();
  12. printf "type: %s\n",$type;
  13. my ($addr,$pow) = cashash('SHA256','~',$salt,$type,5);
  14. printf "addr16: f%s\n",unpack'H*',$addr;
  15. printf "addr58: %s\n",encode_base58f($addr);
  16. $addr = CASWrite('CAStore',undef,$salt,$type,5);
  17. printf "addr: %s\n",$addr;
  18. exit $?;
  19. 1;