Base58.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /**
  2. * Base58 tests.
  3. *
  4. * @author tlwr [toby@toby.codes]
  5. *
  6. * @copyright Crown Copyright 2017
  7. * @license Apache-2.0
  8. */
  9. TestRegister.addTests([
  10. {
  11. name: "To Base58 (Bitcoin): nothing",
  12. input: "",
  13. expectedOutput: "",
  14. recipeConfig: [
  15. {
  16. op: "To Base58",
  17. args: ["123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],
  18. },
  19. ],
  20. },
  21. {
  22. name: "To Base58 (Ripple): nothing",
  23. input: "",
  24. expectedOutput: "",
  25. recipeConfig: [
  26. {
  27. op: "To Base58",
  28. args: ["rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"],
  29. },
  30. ],
  31. },
  32. {
  33. name: "To Base58 (Bitcoin): 'hello world'",
  34. input: "hello world",
  35. expectedOutput: "StV1DL6CwTryKyV",
  36. recipeConfig: [
  37. {
  38. op: "To Base58",
  39. args: ["123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],
  40. },
  41. ],
  42. },
  43. {
  44. name: "To Base58 (Ripple): 'hello world'",
  45. input: "hello world",
  46. expectedOutput: "StVrDLaUATiyKyV",
  47. recipeConfig: [
  48. {
  49. op: "To Base58",
  50. args: ["rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"],
  51. },
  52. ],
  53. },
  54. {
  55. name: "From Base58 (Bitcoin): 'StV1DL6CwTryKyV'",
  56. input: "StV1DL6CwTryKyV",
  57. expectedOutput: "hello world",
  58. recipeConfig: [
  59. {
  60. op: "From Base58",
  61. args: ["123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],
  62. },
  63. ],
  64. },
  65. {
  66. name: "From Base58 (Ripple): 'StVrDLaUATiyKyV'",
  67. input: "StVrDLaUATiyKyV",
  68. expectedOutput: "hello world",
  69. recipeConfig: [
  70. {
  71. op: "From Base58",
  72. args: ["rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"],
  73. },
  74. ],
  75. },
  76. ]);