module Base58

Overview

TODO Write documentation for Base58

Defined in:

base58/alphabet.cr
base58/alphabet/avalanche.cr
base58/alphabet/bitcoin.cr
base58/alphabet/flickr.cr
base58/alphabet/ipfs.cr
base58/alphabet/monero.cr
base58/alphabet/polkadot.cr
base58/alphabet/ripple.cr
base58/base58check.cr
base58/cb58.cr
base58/check.cr
base58/checksum.cr
base58/checksum_mismatch.cr
base58/decoder.cr
base58/decoder_check.cr
base58/encoder.cr
base58/encoder_check.cr
base58/pointer_collection.cr
base58/singletons/blake2bengine.cr
base58/singletons/shaengine1.cr
base58/singletons/shaengine2.cr
base58/ss58.cr
base58/version.cr

Constant Summary

Blake2bEngine = OpenSSL::Digest.new("blake2b512")

SHAEngine1 is a preallocated Digest::SHA256 for Base58Check and CB58 checksum calculation.

BlakeBuffer = Bytes.new(64)

This is a preallocated buffer for calculating SS58 checksums. This implementation, without any sort of mutex/locking, is NOT threadsafe. TODO would be to make it so.

BlakeBufferPtr = BlakeBuffer.to_unsafe
SHABuffer = Bytes.new(32)

This is a preallocated buffer for calculating Base58Check / CB58 checksums. This implementation, without any sort of mutex/locking, is NOT threadsafe. TODO would be to make it so.

SHABufferPtr = SHABuffer.to_unsafe
SHAEngine1 = Digest::SHA256.new

SHAEngine1 is a preallocated Digest::SHA256 for Base58Check and CB58 checksum calculation.

SHAEngine2 = Digest::SHA256.new

SHAEngine2 is a preallocated Digest::SHA256 for Base58Check checksum calculation.

SizeLookup = begin Int32.static_array(0, 3.365658237309761.to_u32, 4.731316474619522.to_u32, 6.096974711929283.to_u32, 7.462632949239044.to_u32, 8.828291186548805.to_u32, 10.193949423858566.to_u32, 11.559607661168327.to_u32, 12.925265898478088.to_u32, 14.290924135787849.to_u32, 15.65658237309761.to_u32, 17.022240610407373.to_u32, 18.387898847717132.to_u32, 19.75355708502689.to_u32, 21.119215322336654.to_u32, 22.484873559646417.to_u32, 23.850531796956176.to_u32, 25.216190034265935.to_u32, 26.581848271575698.to_u32, 27.94750650888546.to_u32, 29.31316474619522.to_u32, 30.67882298350498.to_u32, 32.044481220814745.to_u32, 33.410139458124505.to_u32, 34.775797695434264.to_u32, 36.14145593274402.to_u32, 37.50711417005378.to_u32, 38.87277240736355.to_u32, 40.23843064467331.to_u32, 41.60408888198307.to_u32, 42.96974711929283.to_u32, 44.33540535660259.to_u32, 45.70106359391235.to_u32, 47.06672183122211.to_u32, 48.43238006853187.to_u32, 49.79803830584164.to_u32, 51.163696543151396.to_u32, 52.529354780461155.to_u32, 53.89501301777092.to_u32, 55.26067125508068.to_u32, 56.62632949239044.to_u32, 57.9919877297002.to_u32, 59.35764596700996.to_u32, 60.723304204319724.to_u32, 62.088962441629484.to_u32, 63.45462067893924.to_u32, 64.82027891624901.to_u32, 66.18593715355877.to_u32, 67.55159539086853.to_u32, 68.91725362817829.to_u32, 70.28291186548805.to_u32, 71.6485701027978.to_u32, 73.01422834010756.to_u32, 74.37988657741734.to_u32, 75.7455448147271.to_u32, 77.11120305203686.to_u32, 78.47686128934662.to_u32, 79.84251952665637.to_u32, 81.20817776396613.to_u32, 82.5738360012759.to_u32, 83.93949423858567.to_u32, 85.30515247589543.to_u32, 86.67081071320519.to_u32, 88.03646895051494.to_u32, 89.4021271878247.to_u32, 90.76778542513446.to_u32, 92.13344366244422.to_u32, 93.49910189975398.to_u32, 94.86476013706374.to_u32, 96.23041837437351.to_u32, 97.59607661168327.to_u32, 98.96173484899303.to_u32, 100.32739308630279.to_u32, 101.69305132361255.to_u32, 103.05870956092231.to_u32, 104.42436779823207.to_u32, 105.79002603554184.to_u32, 107.1556842728516.to_u32, 108.52134251016136.to_u32, 109.88700074747112.to_u32, 111.25265898478088.to_u32, 112.61831722209064.to_u32, 113.9839754594004.to_u32, 115.34963369671016.to_u32, 116.71529193401992.to_u32, 118.08095017132969.to_u32, 119.44660840863945.to_u32, 120.81226664594921.to_u32, 122.17792488325897.to_u32, 123.54358312056873.to_u32, 124.90924135787849.to_u32, 126.27489959518824.to_u32, 127.64055783249802.to_u32, 129.00621606980778.to_u32, 130.37187430711754.to_u32, 131.7375325444273.to_u32, 133.10319078173706.to_u32, 134.46884901904681.to_u32, 135.83450725635657.to_u32, 137.20016549366633.to_u32, 138.5658237309761.to_u32, 139.93148196828585.to_u32, 141.2971402055956.to_u32, 142.66279844290537.to_u32, 144.02845668021513.to_u32, 145.39411491752492.to_u32, 146.75977315483468.to_u32, 148.12543139214443.to_u32, 149.4910896294542.to_u32, 150.85674786676395.to_u32, 152.2224061040737.to_u32, 153.58806434138347.to_u32, 154.95372257869323.to_u32, 156.319380816003.to_u32, 157.68503905331275.to_u32, 159.0506972906225.to_u32, 160.41635552793227.to_u32, 161.78201376524203.to_u32, 163.1476720025518.to_u32, 164.51333023986155.to_u32, 165.87898847717133.to_u32, 167.2446467144811.to_u32, 168.61030495179085.to_u32, 169.9759631891006.to_u32, 171.34162142641037.to_u32, 172.70727966372013.to_u32, 174.0729379010299.to_u32, 175.43859613833965.to_u32, 176.8042543756494.to_u32, 178.16991261295917.to_u32, 179.53557085026893.to_u32, 180.90122908757868.to_u32, 182.26688732488844.to_u32, 183.6325455621982.to_u32, 184.99820379950796.to_u32, 186.36386203681772.to_u32, 187.72952027412748.to_u32, 189.09517851143727.to_u32, 190.46083674874703.to_u32, 191.8264949860568.to_u32, 193.19215322336655.to_u32, 194.5578114606763.to_u32, 195.92346969798606.to_u32, 197.28912793529582.to_u32, 198.65478617260558.to_u32, 200.02044440991534.to_u32, 201.3861026472251.to_u32, 202.75176088453486.to_u32, 204.11741912184462.to_u32, 205.48307735915438.to_u32, 206.84873559646414.to_u32, 208.2143938337739.to_u32, 209.58005207108368.to_u32, 210.94571030839344.to_u32, 212.3113685457032.to_u32, 213.67702678301296.to_u32, 215.04268502032272.to_u32, 216.40834325763248.to_u32, 217.77400149494224.to_u32, 219.139659732252.to_u32, 220.50531796956176.to_u32, 221.87097620687152.to_u32, 223.23663444418128.to_u32, 224.60229268149104.to_u32, 225.9679509188008.to_u32, 227.33360915611055.to_u32, 228.6992673934203.to_u32, 230.06492563073007.to_u32, 231.43058386803983.to_u32, 232.79624210534962.to_u32, 234.16190034265938.to_u32, 235.52755857996914.to_u32, 236.8932168172789.to_u32, 238.25887505458866.to_u32, 239.62453329189842.to_u32, 240.99019152920818.to_u32, 242.35584976651793.to_u32, 243.7215080038277.to_u32, 245.08716624113745.to_u32, 246.4528244784472.to_u32, 247.81848271575697.to_u32, 249.18414095306673.to_u32, 250.5497991903765.to_u32, 251.91545742768625.to_u32, 253.28111566499604.to_u32, 254.6467739023058.to_u32, 256.01243213961556.to_u32, 257.37809037692534.to_u32, 258.7437486142351.to_u32, 260.1094068515448.to_u32, 261.4750650888546.to_u32, 262.8407233261643.to_u32, 264.2063815634741.to_u32, 265.5720398007839.to_u32, 266.93769803809363.to_u32, 268.3033562754034.to_u32, 269.66901451271315.to_u32, 271.03467275002293.to_u32, 272.40033098733267.to_u32, 273.76598922464245.to_u32, 275.1316474619522.to_u32, 276.497305699262.to_u32, 277.8629639365717.to_u32, 279.2286221738815.to_u32, 280.5942804111912.to_u32, 281.959938648501.to_u32, 283.32559688581074.to_u32, 284.6912551231205.to_u32, 286.05691336043026.to_u32, 287.42257159774005.to_u32, 288.78822983504983.to_u32, 290.15388807235956.to_u32, 291.51954630966935.to_u32, 292.8852045469791.to_u32, 294.25086278428887.to_u32, 295.6165210215986.to_u32, 296.9821792589084.to_u32, 298.3478374962181.to_u32, 299.7134957335279.to_u32, 301.07915397083764.to_u32, 302.4448122081474.to_u32, 303.81047044545716.to_u32, 305.17612868276694.to_u32, 306.5417869200767.to_u32, 307.90744515738646.to_u32, 309.27310339469625.to_u32, 310.638761632006.to_u32, 312.00441986931577.to_u32, 313.3700781066255.to_u32, 314.7357363439353.to_u32, 316.101394581245.to_u32, 317.4670528185548.to_u32, 318.83271105586454.to_u32, 320.1983692931743.to_u32, 321.56402753048405.to_u32, 322.92968576779384.to_u32, 324.2953440051036.to_u32, 325.66100224241336.to_u32, 327.0266604797231.to_u32, 328.3923187170329.to_u32, 329.75797695434267.to_u32, 331.1236351916524.to_u32, 332.4892934289622.to_u32, 333.8549516662719.to_u32, 335.2206099035817.to_u32, 336.58626814089143.to_u32, 337.9519263782012.to_u32, 339.31758461551095.to_u32, 340.68324285282074.to_u32, 342.04890109013047.to_u32, 343.41455932744026.to_u32, 344.78021756475.to_u32, 346.1458758020598.to_u32, 347.5115340393695.to_u32, 348.8771922766793.to_u32, 350.242850513989.to_u32, 351.6085087512988.to_u32, 352.9741669886086.to_u32, 354.33982522591833.to_u32, 355.7054834632281.to_u32, 357.07114170053785.to_u32, 358.43679993784764.to_u32, 359.80245817515737.to_u32, 361.16811641246716.to_u32, 362.5337746497769.to_u32, 363.8994328870867.to_u32, 365.2650911243964.to_u32, 366.6307493617062.to_u32, 367.9964075990159.to_u32, 369.3620658363257.to_u32, 370.72772407363544.to_u32, 372.09338231094523.to_u32, 373.45904054825496.to_u32, 374.82469878556475.to_u32, 376.19035702287454.to_u32, 377.55601526018427.to_u32, 378.92167349749406.to_u32, 380.2873317348038.to_u32, 381.6529899721136.to_u32, 383.0186482094233.to_u32, 384.3843064467331.to_u32, 385.7499646840428.to_u32, 387.1156229213526.to_u32, 388.48128115866234.to_u32, 389.84693939597213.to_u32, 391.21259763328186.to_u32, 392.57825587059165.to_u32, 393.9439141079014.to_u32, 395.30957234521117.to_u32, 396.67523058252095.to_u32, 398.0408888198307.to_u32, 399.4065470571405.to_u32, 400.7722052944502.to_u32, 402.13786353176.to_u32, 403.5035217690697.to_u32, 404.8691800063795.to_u32, 406.23483824368924.to_u32, 407.600496480999.to_u32, 408.96615471830876.to_u32, 410.33181295561855.to_u32, 411.6974711929283.to_u32, 413.06312943023806.to_u32, 414.4287876675478.to_u32, 415.7944459048576.to_u32, 417.16010414216737.to_u32, 418.5257623794771.to_u32, 419.8914206167869.to_u32, 421.2570788540966.to_u32, 422.6227370914064.to_u32, 423.98839532871614.to_u32, 425.3540535660259.to_u32, 426.71971180333566.to_u32, 428.08537004064544.to_u32, 429.4510282779552.to_u32, 430.81668651526496.to_u32, 432.1823447525747.to_u32, 433.5480029898845.to_u32, 434.9136612271942.to_u32, 436.279319464504.to_u32, 437.64497770181373.to_u32, 439.0106359391235.to_u32, 440.3762941764333.to_u32, 441.74195241374304.to_u32, 443.1076106510528.to_u32, 444.47326888836255.to_u32, 445.83892712567234.to_u32, 447.2045853629821.to_u32, 448.57024360029186.to_u32, 449.9359018376016.to_u32, 451.3015600749114.to_u32, 452.6672183122211.to_u32, 454.0328765495309.to_u32, 455.3985347868406.to_u32, 456.7641930241504.to_u32, 458.12985126146015.to_u32, 459.49550949876993.to_u32, 460.86116773607966.to_u32, 462.22682597338945.to_u32, 463.59248421069924.to_u32, 464.95814244800897.to_u32, 466.32380068531876.to_u32, 467.6894589226285.to_u32, 469.0551171599383.to_u32, 470.420775397248.to_u32, 471.7864336345578.to_u32, 473.1520918718675.to_u32, 474.5177501091773.to_u32, 475.88340834648704.to_u32, 477.24906658379683.to_u32, 478.61472482110656.to_u32, 479.98038305841635.to_u32, 481.3460412957261.to_u32, 482.71169953303587.to_u32, 484.07735777034566.to_u32, 485.4430160076554.to_u32, 486.8086742449652.to_u32, 488.1743324822749.to_u32, 489.5399907195847.to_u32, 490.9056489568944.to_u32, 492.2713071942042.to_u32, 493.63696543151394.to_u32, 495.00262366882373.to_u32, 496.36828190613346.to_u32, 497.73394014344325.to_u32, 499.099598380753.to_u32, 500.46525661806277.to_u32, 501.8309148553725.to_u32, 503.1965730926823.to_u32, 504.5622313299921.to_u32, 505.9278895673018.to_u32, 507.2935478046116.to_u32, 508.6592060419213.to_u32, 510.0248642792311.to_u32, 511.39052251654084.to_u32, 512.7561807538507.to_u32, 514.1218389911604.to_u32, 515.4874972284701.to_u32, 516.8531554657799.to_u32, 518.2188137030896.to_u32, 519.5844719403995.to_u32, 520.9501301777092.to_u32, 522.3157884150189.to_u32, 523.6814466523286.to_u32, 525.0471048896385.to_u32, 526.4127631269482.to_u32, 527.778421364258.to_u32, 529.1440796015678.to_u32, 530.5097378388775.to_u32, 531.8753960761873.to_u32, 533.241054313497.to_u32, 534.6067125508068.to_u32, 535.9723707881166.to_u32, 537.3380290254263.to_u32, 538.703687262736.to_u32, 540.0693455000459.to_u32, 541.4350037373556.to_u32, 542.8006619746653.to_u32, 544.1663202119751.to_u32, 545.5319784492849.to_u32, 546.8976366865946.to_u32, 548.2632949239044.to_u32, 549.6289531612142.to_u32, 550.994611398524.to_u32, 552.3602696358337.to_u32, 553.7259278731434.to_u32, 555.0915861104532.to_u32, 556.457244347763.to_u32, 557.8229025850727.to_u32, 559.1885608223824.to_u32, 560.5542190596923.to_u32, 561.919877297002.to_u32, 563.2855355343117.to_u32, 564.6511937716215.to_u32, 566.0168520089313.to_u32, 567.382510246241.to_u32, 568.7481684835508.to_u32, 570.1138267208605.to_u32, 571.4794849581704.to_u32, 572.8451431954801.to_u32, 574.2108014327898.to_u32, 575.5764596700997.to_u32, 576.9421179074094.to_u32, 578.3077761447191.to_u32, 579.6734343820289.to_u32, 581.0390926193387.to_u32, 582.4047508566484.to_u32, 583.7704090939582.to_u32, 585.1360673312679.to_u32, 586.5017255685777.to_u32, 587.8673838058875.to_u32, 589.2330420431972.to_u32, 590.5987002805069.to_u32, 591.9643585178168.to_u32, 593.3300167551265.to_u32, 594.6956749924362.to_u32, 596.0613332297461.to_u32, 597.4269914670558.to_u32, 598.7926497043655.to_u32, 600.1583079416753.to_u32, 601.5239661789851.to_u32, 602.8896244162949.to_u32, 604.2552826536046.to_u32, 605.6209408909143.to_u32, 606.9865991282242.to_u32, 608.3522573655339.to_u32, 609.7179156028436.to_u32, 611.0835738401533.to_u32, 612.4492320774632.to_u32, 613.8148903147729.to_u32, 615.1805485520827.to_u32, 616.5462067893925.to_u32, 617.9118650267022.to_u32, 619.277523264012.to_u32, 620.6431815013217.to_u32, 622.0088397386315.to_u32, 623.3744979759413.to_u32, 624.740156213251.to_u32, 626.1058144505607.to_u32, 627.4714726878706.to_u32, 628.8371309251803.to_u32, 630.20278916249.to_u32, 631.5684473997998.to_u32, 632.9341056371096.to_u32, 634.2997638744193.to_u32, 635.6654221117291.to_u32, 637.0310803490389.to_u32, 638.3967385863486.to_u32, 639.7623968236584.to_u32, 641.1280550609681.to_u32, 642.493713298278.to_u32, 643.8593715355877.to_u32, 645.2250297728974.to_u32, 646.5906880102071.to_u32, 647.956346247517.to_u32, 649.3220044848267.to_u32, 650.6876627221365.to_u32, 652.0533209594462.to_u32, 653.418979196756.to_u32, 654.7846374340658.to_u32, 656.1502956713755.to_u32, 657.5159539086853.to_u32, 658.8816121459951.to_u32, 660.2472703833048.to_u32, 661.6129286206145.to_u32, 662.9785868579244.to_u32, 664.3442450952341.to_u32, 665.7099033325438.to_u32, 667.0755615698536.to_u32, 668.4412198071634.to_u32, 669.8068780444731.to_u32, 671.1725362817829.to_u32, 672.5381945190926.to_u32, 673.9038527564024.to_u32, 675.2695109937122.to_u32, 676.6351692310219.to_u32, 678.0008274683316.to_u32, 679.3664857056415.to_u32, 680.7321439429512.to_u32, 682.0978021802609.to_u32, 683.4634604175708.to_u32, 684.8291186548805.to_u32, 686.1947768921902.to_u32, 687.5604351295.to_u32, 688.9260933668098.to_u32, 690.2917516041196.to_u32, 691.6574098414293.to_u32, 693.023068078739.to_u32, 694.3887263160489.to_u32, 695.7543845533586.to_u32, 697.1200427906683.to_u32, 698.485701027978.to_u32, 699.8513592652879.to_u32, 701.2170175025976.to_u32, 702.5826757399074.to_u32, 703.9483339772172.to_u32, 705.3139922145269.to_u32, 706.6796504518367.to_u32, 708.0453086891464.to_u32, 709.4109669264562.to_u32, 710.776625163766.to_u32, 712.1422834010757.to_u32, 713.5079416383854.to_u32, 714.8735998756953.to_u32, 716.239258113005.to_u32, 717.6049163503147.to_u32, 718.9705745876245.to_u32, 720.3362328249343.to_u32, 721.701891062244.to_u32, 723.0675492995538.to_u32, 724.4332075368636.to_u32, 725.7988657741734.to_u32, 727.1645240114831.to_u32, 728.5301822487928.to_u32, 729.8958404861027.to_u32, 731.2614987234124.to_u32, 732.6271569607221.to_u32, 733.9928151980318.to_u32, 735.3584734353417.to_u32, 736.7241316726514.to_u32, 738.0897899099612.to_u32, 739.4554481472709.to_u32, 740.8211063845807.to_u32, 742.1867646218905.to_u32, 743.5524228592002.to_u32, 744.9180810965099.to_u32, 746.2837393338198.to_u32, 747.6493975711295.to_u32, 749.0150558084392.to_u32, 750.3807140457491.to_u32, 751.7463722830588.to_u32, 753.1120305203685.to_u32, 754.4776887576783.to_u32, 755.8433469949881.to_u32, 757.2090052322978.to_u32, 758.5746634696076.to_u32, 759.9403217069173.to_u32, 761.3059799442271.to_u32, 762.6716381815369.to_u32, 764.0372964188466.to_u32, 765.4029546561563.to_u32, 766.7686128934662.to_u32, 768.1342711307759.to_u32, 769.4999293680856.to_u32, 770.8655876053955.to_u32, 772.2312458427052.to_u32, 773.596904080015.to_u32, 774.9625623173247.to_u32, 776.3282205546345.to_u32, 777.6938787919443.to_u32, 779.059537029254.to_u32, 780.4251952665637.to_u32, 781.7908535038736.to_u32, 783.1565117411833.to_u32, 784.522169978493.to_u32, 785.8878282158028.to_u32, 787.2534864531126.to_u32, 788.6191446904223.to_u32, 789.9848029277321.to_u32, 791.3504611650419.to_u32, 792.7161194023516.to_u32, 794.0817776396614.to_u32, 795.4474358769711.to_u32, 796.813094114281.to_u32, 798.1787523515907.to_u32, 799.5444105889004.to_u32, 800.9100688262101.to_u32, 802.27572706352.to_u32, 803.6413853008297.to_u32, 805.0070435381394.to_u32, 806.3727017754492.to_u32, 807.738360012759.to_u32, 809.1040182500687.to_u32, 810.4696764873785.to_u32, 811.8353347246883.to_u32, 813.200992961998.to_u32, 814.5666511993078.to_u32, 815.9323094366175.to_u32, 817.2979676739274.to_u32, 818.6636259112371.to_u32, 820.0292841485468.to_u32, 821.3949423858566.to_u32, 822.7606006231664.to_u32, 824.1262588604761.to_u32, 825.4919170977859.to_u32, 826.8575753350956.to_u32, 828.2232335724054.to_u32, 829.5888918097152.to_u32, 830.9545500470249.to_u32, 832.3202082843347.to_u32, 833.6858665216445.to_u32, 835.0515247589542.to_u32, 836.4171829962639.to_u32, 837.7828412335738.to_u32, 839.1484994708835.to_u32, 840.5141577081932.to_u32, 841.879815945503.to_u32, 843.2454741828128.to_u32, 844.6111324201225.to_u32, 845.9767906574323.to_u32, 847.342448894742.to_u32, 848.7081071320519.to_u32, 850.0737653693616.to_u32, 851.4394236066713.to_u32, 852.805081843981.to_u32, 854.1707400812909.to_u32, 855.5363983186006.to_u32, 856.9020565559103.to_u32, 858.2677147932202.to_u32, 859.6333730305299.to_u32, 860.9990312678397.to_u32, 862.3646895051494.to_u32, 863.7303477424592.to_u32, 865.096005979769.to_u32, 866.4616642170787.to_u32, 867.8273224543884.to_u32, 869.1929806916983.to_u32, 870.558638929008.to_u32, 871.9242971663177.to_u32, 873.2899554036275.to_u32, 874.6556136409373.to_u32, 876.021271878247.to_u32, 877.3869301155568.to_u32, 878.7525883528666.to_u32, 880.1182465901763.to_u32, 881.4839048274861.to_u32, 882.8495630647958.to_u32, 884.2152213021056.to_u32, 885.5808795394154.to_u32, 886.9465377767251.to_u32, 888.3121960140348.to_u32, 889.6778542513447.to_u32, 891.0435124886544.to_u32, 892.4091707259641.to_u32, 893.7748289632739.to_u32, 895.1404872005837.to_u32, 896.5061454378935.to_u32, 897.8718036752032.to_u32, 899.237461912513.to_u32, 900.6031201498228.to_u32, 901.9687783871325.to_u32, 903.3344366244422.to_u32, 904.7000948617521.to_u32, 906.0657530990618.to_u32, 907.4314113363715.to_u32, 908.7970695736813.to_u32, 910.1627278109911.to_u32, 911.5283860483008.to_u32, 912.8940442856106.to_u32, 914.2597025229203.to_u32, 915.6253607602301.to_u32, 916.9910189975399.to_u32, 918.3566772348496.to_u32, 919.7223354721593.to_u32, 921.0879937094692.to_u32, 922.4536519467789.to_u32, 923.8193101840886.to_u32, 925.1849684213985.to_u32, 926.5506266587082.to_u32, 927.9162848960179.to_u32, 929.2819431333277.to_u32, 930.6476013706375.to_u32, 932.0132596079472.to_u32, 933.378917845257.to_u32, 934.7445760825667.to_u32, 936.1102343198766.to_u32, 937.4758925571863.to_u32, 938.841550794496.to_u32, 940.2072090318057.to_u32, 941.5728672691156.to_u32, 942.9385255064253.to_u32, 944.304183743735.to_u32, 945.6698419810449.to_u32, 947.0355002183546.to_u32, 948.4011584556644.to_u32, 949.7668166929741.to_u32, 951.1324749302839.to_u32, 952.4981331675937.to_u32, 953.8637914049034.to_u32, 955.2294496422131.to_u32, 956.595107879523.to_u32, 957.9607661168327.to_u32, 959.3264243541424.to_u32, 960.6920825914522.to_u32, 962.057740828762.to_u32, 963.4233990660717.to_u32, 964.7890573033815.to_u32, 966.1547155406913.to_u32, 967.520373778001.to_u32, 968.8860320153108.to_u32, 970.2516902526205.to_u32, 971.6173484899304.to_u32, 972.9830067272401.to_u32, 974.3486649645498.to_u32, 975.7143232018595.to_u32, 977.0799814391694.to_u32, 978.4456396764791.to_u32, 979.8112979137888.to_u32, 981.1769561510986.to_u32, 982.5426143884084.to_u32, 983.9082726257182.to_u32, 985.2739308630279.to_u32, 986.6395891003377.to_u32, 988.0052473376475.to_u32, 989.3709055749572.to_u32, 990.7365638122669.to_u32, 992.1022220495768.to_u32, 993.4678802868865.to_u32, 994.8335385241962.to_u32, 996.199196761506.to_u32, 997.5648549988158.to_u32, 998.9305132361255.to_u32, 1000.2961714734353.to_u32, 1001.661829710745.to_u32, 1003.0274879480548.to_u32, 1004.3931461853646.to_u32, 1005.7588044226743.to_u32, 1007.1244626599841.to_u32, 1008.4901208972939.to_u32, 1009.8557791346036.to_u32, 1011.2214373719133.to_u32, 1012.5870956092232.to_u32, 1013.9527538465329.to_u32, 1015.3184120838426.to_u32, 1016.6840703211524.to_u32, 1018.0497285584622.to_u32, 1019.415386795772.to_u32, 1020.7810450330817.to_u32, 1022.1467032703914.to_u32, 1023.5123615077013.to_u32, 1024.878019745011.to_u32, 1026.2436779823208.to_u32, 1027.6093362196304.to_u32, 1028.9749944569403.to_u32, 1030.3406526942501.to_u32, 1031.7063109315598.to_u32, 1033.0719691688696.to_u32, 1034.4376274061792.to_u32, 1035.803285643489.to_u32, 1037.168943880799.to_u32, 1038.5346021181085.to_u32, 1039.9002603554184.to_u32, 1041.2659185927282.to_u32, 1042.6315768300378.to_u32, 1043.9972350673477.to_u32, 1045.3628933046573.to_u32, 1046.7285515419671.to_u32, 1048.094209779277.to_u32, 1049.4598680165866.to_u32, 1050.8255262538964.to_u32, 1052.1911844912063.to_u32, 1053.556842728516.to_u32, 1054.9225009658257.to_u32, 1056.2881592031356.to_u32, 1057.6538174404452.to_u32, 1059.019475677755.to_u32, 1060.3851339150647.to_u32, 1061.7507921523745.to_u32, 1063.1164503896844.to_u32, 1064.482108626994.to_u32, 1065.8477668643038.to_u32, 1067.2134251016137.to_u32, 1068.5790833389233.to_u32, 1069.9447415762331.to_u32, 1071.3103998135427.to_u32, 1072.6760580508526.to_u32, 1074.0417162881624.to_u32, 1075.407374525472.to_u32, 1076.773032762782.to_u32, 1078.1386910000917.to_u32, 1079.5043492374014.to_u32, 1080.8700074747112.to_u32, 1082.235665712021.to_u32, 1083.6013239493307.to_u32, 1084.9669821866405.to_u32, 1086.3326404239501.to_u32, 1087.69829866126.to_u32, 1089.0639568985698.to_u32, 1090.4296151358794.to_u32, 1091.7952733731893.to_u32, 1093.1609316104991.to_u32, 1094.5265898478087.to_u32, 1095.8922480851186.to_u32, 1097.2579063224284.to_u32, 1098.623564559738.to_u32, 1099.989222797048.to_u32, 1101.3548810343575.to_u32, 1102.7205392716673.to_u32, 1104.0861975089772.to_u32, 1105.4518557462868.to_u32, 1106.8175139835967.to_u32, 1108.1831722209065.to_u32, 1109.5488304582161.to_u32, 1110.914488695526.to_u32, 1112.2801469328356.to_u32, 1113.6458051701454.to_u32, 1115.0114634074553.to_u32, 1116.3771216447649.to_u32, 1117.7427798820747.to_u32, 1119.1084381193846.to_u32, 1120.4740963566942.to_u32, 1121.839754594004.to_u32, 1123.2054128313139.to_u32, 1124.5710710686235.to_u32, 1125.9367293059333.to_u32, 1127.302387543243.to_u32, 1128.6680457805528.to_u32, 1130.0337040178626.to_u32, 1131.3993622551723.to_u32, 1132.765020492482.to_u32, 1134.130678729792.to_u32, 1135.4963369671016.to_u32, 1136.8619952044114.to_u32, 1138.227653441721.to_u32, 1139.5933116790309.to_u32, 1140.9589699163407.to_u32, 1142.3246281536503.to_u32, 1143.6902863909602.to_u32, 1145.05594462827.to_u32, 1146.4216028655796.to_u32, 1147.7872611028895.to_u32, 1149.1529193401993.to_u32, 1150.518577577509.to_u32, 1151.8842358148188.to_u32, 1153.2498940521284.to_u32, 1154.6155522894383.to_u32, 1155.981210526748.to_u32, 1157.3468687640577.to_u32, 1158.7125270013676.to_u32, 1160.0781852386774.to_u32, 1161.443843475987.to_u32, 1162.8095017132969.to_u32, 1164.1751599506067.to_u32, 1165.5408181879163.to_u32, 1166.9064764252262.to_u32, 1168.2721346625358.to_u32, 1169.6377928998456.to_u32, 1171.0034511371555.to_u32, 1172.369109374465.to_u32, 1173.734767611775.to_u32, 1175.1004258490848.to_u32, 1176.4660840863944.to_u32, 1177.8317423237042.to_u32, 1179.1974005610139.to_u32, 1180.5630587983237.to_u32, 1181.9287170356336.to_u32, 1183.2943752729432.to_u32, 1184.660033510253.to_u32, 1186.0256917475629.to_u32, 1187.3913499848725.to_u32, 1188.7570082221823.to_u32, 1190.1226664594922.to_u32, 1191.4883246968018.to_u32, 1192.8539829341116.to_u32, 1194.2196411714212.to_u32, 1195.585299408731.to_u32, 1196.950957646041.to_u32, 1198.3166158833506.to_u32, 1199.6822741206604.to_u32, 1201.0479323579702.to_u32, 1202.4135905952799.to_u32, 1203.7792488325897.to_u32, 1205.1449070698995.to_u32, 1206.5105653072092.to_u32, 1207.876223544519.to_u32, 1209.2418817818286.to_u32, 1210.6075400191385.to_u32, 1211.9731982564483.to_u32, 1213.338856493758.to_u32, 1214.7045147310678.to_u32, 1216.0701729683776.to_u32, 1217.4358312056872.to_u32, 1218.801489442997.to_u32, 1220.1671476803067.to_u32, 1221.5328059176165.to_u32, 1222.8984641549264.to_u32, 1224.264122392236.to_u32, 1225.6297806295458.to_u32, 1226.9954388668557.to_u32, 1228.3610971041653.to_u32, 1229.7267553414752.to_u32, 1231.092413578785.to_u32, 1232.4580718160946.to_u32, 1233.8237300534045.to_u32, 1235.189388290714.to_u32, 1236.555046528024.to_u32, 1237.9207047653338.to_u32, 1239.2863630026434.to_u32, 1240.6520212399532.to_u32, 1242.017679477263.to_u32, 1243.3833377145727.to_u32, 1244.7489959518825.to_u32, 1246.1146541891922.to_u32, 1247.480312426502.to_u32, 1248.8459706638118.to_u32, 1250.2116289011215.to_u32, 1251.5772871384313.to_u32, 1252.9429453757411.to_u32, 1254.3086036130508.to_u32, 1255.6742618503606.to_u32, 1257.0399200876705.to_u32, 1258.40557832498.to_u32, 1259.77123656229.to_u32, 1261.1368947995995.to_u32, 1262.5025530369094.to_u32, 1263.8682112742192.to_u32, 1265.2338695115288.to_u32, 1266.5995277488387.to_u32, 1267.9651859861485.to_u32, 1269.3308442234581.to_u32, 1270.696502460768.to_u32, 1272.0621606980778.to_u32, 1273.4278189353874.to_u32, 1274.7934771726973.to_u32, 1276.159135410007.to_u32, 1277.5247936473168.to_u32, 1278.8904518846266.to_u32, 1280.2561101219362.to_u32, 1281.621768359246.to_u32, 1282.987426596556.to_u32, 1284.3530848338655.to_u32, 1285.7187430711754.to_u32, 1287.084401308485.to_u32, 1288.4500595457948.to_u32, 1289.8157177831047.to_u32, 1291.1813760204143.to_u32, 1292.5470342577241.to_u32, 1293.912692495034.to_u32, 1295.2783507323436.to_u32, 1296.6440089696534.to_u32, 1298.0096672069633.to_u32, 1299.375325444273.to_u32, 1300.7409836815827.to_u32, 1302.1066419188924.to_u32, 1303.4723001562022.to_u32, 1304.837958393512.to_u32, 1306.2036166308217.to_u32, 1307.5692748681315.to_u32, 1308.9349331054414.to_u32, 1310.300591342751.to_u32, 1311.6662495800608.to_u32, 1313.0319078173707.to_u32, 1314.3975660546803.to_u32, 1315.7632242919901.to_u32, 1317.1288825292997.to_u32, 1318.4945407666096.to_u32, 1319.8601990039194.to_u32, 1321.225857241229.to_u32, 1322.591515478539.to_u32, 1323.9571737158487.to_u32, 1325.3228319531584.to_u32, 1326.6884901904682.to_u32, 1328.0541484277778.to_u32, 1329.4198066650877.to_u32, 1330.7854649023975.to_u32, 1332.1511231397071.to_u32, 1333.516781377017.to_u32, 1334.8824396143268.to_u32, 1336.2480978516364.to_u32, 1337.6137560889463.to_u32, 1338.9794143262561.to_u32, 1340.3450725635657.to_u32, 1341.7107308008756.to_u32, 1343.0763890381852.to_u32, 1344.442047275495.to_u32, 1345.807705512805.to_u32, 1347.1733637501145.to_u32, 1348.5390219874243.to_u32, 1349.9046802247342.to_u32, 1351.2703384620438.to_u32, 1352.6359966993537.to_u32, 1354.0016549366633.to_u32, 1355.3673131739731.to_u32, 1356.732971411283.to_u32, 1358.0986296485926.to_u32, 1359.4642878859024.to_u32, 1360.8299461232123.to_u32, 1362.1956043605219.to_u32, 1363.5612625978317.to_u32, 1364.9269208351416.to_u32, 1366.2925790724512.to_u32, 1367.658237309761.to_u32, 1369.0238955470707.to_u32, 1370.3895537843805.to_u32, 1371.7552120216903.to_u32, 1373.120870259.to_u32, 1374.4865284963098.to_u32, 1375.8521867336196.to_u32, 1377.2178449709293.to_u32, 1378.583503208239.to_u32, 1379.949161445549.to_u32, 1381.3148196828586.to_u32, 1382.6804779201684.to_u32, 1384.046136157478.to_u32, 1385.4117943947879.to_u32, 1386.7774526320977.to_u32, 1388.1431108694073.to_u32, 1389.5087691067172.to_u32, 1390.874427344027.to_u32, 1392.2400855813366.to_u32, 1393.6057438186465.to_u32, 1394.971402055956.to_u32, 1396.337060293266.to_u32, 1397.7027185305758.to_u32, 1399.0683767678854.to_u32, 1400.4340350051953.to_u32) end
VERSION = "0.2.2"

Class Method Summary

Class Method Detail

def self.decode(value : Pointer(UInt8), size : Int32, check : Check, into : Slice(UInt8).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, check : Check, into : StaticArray(T, N).class, alphabet : Alphabet.class = Alphabet::Bitcoin) forall T, N #

def self.decode(value : Pointer(UInt8), size : Int32, check : Check, into : Pointer.class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, check : Check, into : Array(UInt8).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, check : Check, into : Array(Char).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, check : Check, into : StringBuffer.class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, check : Check, into : StaticArray(UInt8, N), alphabet : Alphabet.class = Alphabet::Bitcoin) forall N #

def self.decode(value : Pointer(UInt8), size : Int32, check : Check, into : String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, check : Check, into : String, mutate : Bool = false, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, check : Check, into : Slice(UInt8), alphabet : Alphabet.class = Alphabet::Bitcoin) forall N #

def self.decode(value : Pointer(UInt8), size : Int32, check : Check, into : Pointer(UInt8), alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, check : Check, into : Array(UInt8), alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, check : Check, into : Array(Char), alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, check : Check, into : StringBuffer, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : String, into = String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : String, into = String, mutate : Bool = false, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Slice(UInt8) | StaticArray(UInt8, N), into = String, alphabet : Alphabet.class = Alphabet::Bitcoin) forall N #

def self.decode(value : Slice(UInt8) | StaticArray(UInt8, N), into : String, mutate : Bool, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Array(UInt8), into = String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Array(Char), into = String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : StringBuffer, into = String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, into : StaticArray(T, N).class, alphabet : Alphabet.class = Alphabet::Bitcoin) forall T, N #

def self.decode(value : Pointer(UInt8), size : Int32, into : Int.class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, into : String.class = String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, into : Slice(UInt8).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, into : Pointer.class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, into : Array(UInt8).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, into : Array(Char).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, into : StringBuffer.class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, into : StaticArray(UInt8, N), alphabet : Alphabet.class = Alphabet::Bitcoin) forall N #

def self.decode(value : Pointer(UInt8), size : Int32, into : String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, into : String, mutate : Bool = false, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, into : Slice(UInt8), alphabet : Alphabet.class = Alphabet::Bitcoin) forall N #

def self.decode(value : Pointer(UInt8), size : Int32, into : Pointer(UInt8), alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, into : Array(UInt8), alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, into : Array(Char), alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Pointer(UInt8), size : Int32, into : StringBuffer, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : String, check : Check, into = String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : String, check : Check, into = String, mutate : Bool = false, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode(value : Slice(UInt8) | StaticArray(UInt8, N), check : Check, into = String, alphabet : Alphabet.class = Alphabet::Bitcoin) forall N #

def self.decode(value : Pointer(UInt8), size : Int32, check : Check, into : String.class = String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode_into_pointer(value : Pointer(UInt8), pointer : Pointer(UInt8), size : Int, alphabet : Alphabet::Monero.class) #

def self.decode_into_pointer(value : Pointer(UInt8), pointer : Pointer(UInt8), size : Int, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode_into_pointer(value : Pointer(UInt8), pointer : Pointer(UInt8), size : Int, check : Check, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Decodes a Base58 encoded value pointed to by value into a pointer pointer. The checksum will be in the bytes returned, but the length returned will not include the checksum.


def self.decode_to_array(value : Pointer(UInt8), size : Int, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.decode_to_array(value : Pointer(UInt8), size : Int, check : Check, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.encode(value : Int, into : String.class = String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode an integer into a string, taking an optional alphabet.


def self.encode(value : Int, into : Pointer.class | Pointer(UInt8).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode an integer into a new raw allocation of memory, returning a pointer to the memory buffer, and the size of the buffer.


def self.encode(value : Int, into : Slice(UInt8).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode an integer into a new Slice.


def self.encode(value : Int, into : StaticArray(T, N).class, alphabet : Alphabet.class = Alphabet::Bitcoin) forall T, N #

Encode an integer into a new StaticArray.


def self.encode(value : Int, into : Array(UInt8).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode an integer into a new Array(UInt8).


def self.encode(value : Int, into : Array(Char).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode an integer into a new Array(Char).


def self.encode(value : Int, into : String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode an integer into an existing String, safely. What this does is to allocate a new String of sufficient length to contain both the original string and the encoded value. It copies the original string into the new string, and the encodes the value directly into the string buffer following the original string before returning the new String.


def self.encode(value : Int, into : String, mutate : Bool = false, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.encode(value : Int, into : StringBuffer, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode an integer into an existing StringBuffer, safely. What this does is to allocate a new Stri


def self.encode(value : Int, into : Array(UInt8) | Array(Char), alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode an Integer into an existing array of UInt8.


def self.encode(value : Int, into : Pointer(UInt8), alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode an integer into an existing pointer. Most of the encoding methods end up here.


def self.encode(value : Int, into : StaticArray(UInt8, _) | Slice(UInt8), alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode an integer into an existing StaticArray(UInt8, _) or Slice(UInt8). The burden is on the user to ensure that there is adequate space in the Slice or StaticArray for the encoded data.

Also, be aware that the idea of encoding into an existing StaticArray works from a syntax point of view, but because a StaticArray lives on the stack, this is not what happens. In Crystal, items which are allocated on the stack are passed by copy, which means that when called on a StaticArray, this code will actually return a new StaticArray with the encoded data inserted into it. i.e. the end result is the same as if the .encode method had been called with a class specification like into: StaticArray(UInt8, 128).


def self.encode(value : String, into : String.class = String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a String into a new String. This is the default.


def self.encode(value : String, into : StringBuffer.class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a String into a new StringBuffer. A StringBuffer is a purpose-built container for a mutable string to be used as a data buffer.


def self.encode(value : String, into : Pointer.class | Pointer(UInt8).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a String into a new raw memory buffer, pointed to by a Pointer(UInt8). This method will allocate a section of memory sufficient to hold the encoded string, and will return a tuple containing the pointer to the raw memory buffer and the size of the buffer.


def self.encode(value : String, into : Slice(UInt8).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a String into a new Slice(UInt8). This method will allocate Slice(UInt8) with sufficient space to contain the encoded data, returning it.


def self.encode(value : String, into : StaticArray(T, N).class, alphabet : Alphabet.class = Alphabet::Bitcoin) forall T, N #

Encode a String into a new StaticArray(UInt8, N). This method will allocate a StaticArray(UInt8, N) with sufficient space to contain the encoded data, returning it.


def self.encode(value : String, into : Array(UInt8).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a String into a new Array(UInt8), returning it. Each byte of the encoded data will be inserted into an element of the array.


def self.encode(value : String, into : Array(Char).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a String into a new Array(Char), returning it. Each byte of the encoded data will be inserted into an element of the array.


def self.encode(value : String, into : String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a String into an existing String. Because Strings are immutable, the return value of this method will be a new String containing the contents of the original string with the encoded data concatenated onto the end of it.


def self.encode(value : String, into : String, mutate : Bool = false, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.encode(value : String, into : StringBuffer, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a string into an existing StringBuffer.


def self.encode(value : String, into : Array(UInt8) | Array(Char), alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a string into an Array(UInt8) or Array(Char). The new values will be appended to whatever already exists in the array.


def self.encode(value : String, into : Pointer(UInt8), alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a string into an existing memory buffer, pointed to by a Pointer(UInt8). There is assumed to be sufficient space in the buffer to hold the encoded data.


def self.encode(value : String, into : StaticArray(UInt8, _) | Slice(UInt8), alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a string into a buffer composed of either a Slice(UInt8) or a StaticArray(UInt8, _). The buffer is assumed to be sufficient space in the buffer to hold the encoded data.


def self.encode(value : StringBuffer, into = String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a StringBuffer into any target that a String can be encoded into. If no target is specified, it will default to a String.


def self.encode(value : Array(UInt8), into = String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes an Array(UInt8) into any target that a String can be encoded into. If no target is specified, it will default to a String.


def self.encode(value : Array(Char), into = String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes an Array(Char) into any target that a String can be encoded into. If no target is specified, it will default to a String.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), into : String.class = String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into a new String. This is the default for encoding a Slice or for a StaticArray.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), into : StringBuffer.class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into a new StringBuffer.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), into : Pointer.class | Pointer(UInt8).class, alphabet : Alphabet.class = Alphabet::Bitcoin) : Tuple(Pointer(UInt8), Int32) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into a newly allocated memory buffer. The buffer will have sufficient size to hold the encoded data. This method will return a tuple containing the pointer to the data, and its byte size.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), into : Slice(UInt8).class, alphabet : Alphabet.class = Alphabet::Bitcoin) : Slice(UInt8) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into a newly allocated Slice. The Slice will have sufficient size to hold the encoded data.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), into : StaticArray(UInt8, N).class, alphabet : Alphabet.class = Alphabet::Bitcoin) forall N #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into a newly allocated StaticArray. The StaticArray will have sufficient size to hold the encoded data. The method will return a tuple containing the StaticArray and its byte size.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), into : Array(UInt8).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into a newly allocated Array(UInt8).


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), into : Array(Char).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into a newly allocated Array(Char).


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), into : String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into an already existing String. This method actually creates a new String that contains a copy of the contents of the original string, and then concatenates the encoded data to it, and returns the new String.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), into : String, mutate : Bool = false, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into an already existing String. This method defaults to the safe, non-mutating behavior, where the encoded data is concatenated to the original string, and a new String is returned. If you want to mutate the original string, set mutate: true.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), into : StringBuffer, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into an already existing StringBuffer.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), into : Array(UInt8) | Array(Char), alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into an already existing Array(UInt8) or Array(Char). The encoded data is appended to the end of the array, one byte per array element.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), into : Pointer(UInt8), alphabet : Alphabet.class = Alphabet::Bitcoin) : Tuple(Pointer(UInt8), Int32) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into an already existing Pointer(UInt8). The pointer is assumed to reference a section of memory large enough to hold the encoded data. The method returns a tuple containing the pointer and the size of the encoded data.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), into : Slice(UInt8), alphabet : Alphabet.class = Alphabet::Bitcoin) : Slice(UInt8) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into an already existing Slice(UInt8). The Slice is assumed to have sufficient space to hold the encoded data.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), into : StaticArray(UInt8, _), alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into an already existing StaticArray(UInt8, _). The StaticArray is assumed to have sufficient space to hold the encoded data.


def self.encode(value : String, check : Base58::Check, into : StaticArray(T, N).class, alphabet : Alphabet.class = Alphabet::Bitcoin) forall T, N #

Encode a String into a new StaticArray(UInt8, N), with checksumming. This method will allocate a StaticArray(UInt8, N) with sufficient space to contain the encoded data, returning it.


def self.encode(value : String, check : Base58::Check, into : String.class = String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a String into a new String, with checksumming. This signature accepts an instance of Base58::Check, which is used to specify the prefix byte(s), if any, and the checksum algorithm to use.


def self.encode(value : String, check : Base58::Check, into : StringBuffer.class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a String into a new StringBuffer, with checksumming. A StringBuffer is a purpose-built container for a mutable string to be used as a data buffer.


def self.encode(value : String, check : Base58::Check, into : Pointer.class | Pointer(UInt8).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a String into a new raw memory buffer, pointed to by a Pointer(UInt8), with checksumming. This method will allocate a section of memory sufficient to hold the encoded string, and will return a tuple containing the pointer to the raw memory buffer and the size of the buffer.


def self.encode(value : String, check : Base58::Check, into : Slice(UInt8).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a String into a new Slice(UInt8), with checksumming. This method will allocate Slice(UInt8) with sufficient space to contain the encoded data, returning it.


def self.encode(value : String, check : Base58::Check, into : Array(UInt8).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a String into a new Array(UInt8), with checksumming. This method will allocate an Array(UInt8) with sufficient space to contain the encoded data, returning it.


def self.encode(value : String, check : Base58::Check, into : Array(Char).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a String into a new Array(Char), with checksumming. This method will allocate an Array(Char) with sufficient space to contain the encoded data, returning it.


def self.encode(value : String, check : Base58::Check, into : String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a String into an existing String, with checksumming. Because Strings are immutable, the return value of this method will be a new String containing the contents of the original string with the encoded data concatenated onto the end of it.


def self.encode(value : String, check : Base58::Check, into : String, mutate : Bool = false, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.encode(value : String, check : Base58::Check, into : StringBuffer, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a string into an existing StringBuffer, with checksumming.


def self.encode(value : String, check : Base58::Check, into : Array(UInt8) | Array(Char), alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a string into an Array(UInt8) or Array(Char), with checksumming. The new values will be appended to whatever already exists in the array.


def self.encode(value : String, check : Base58::Check, into : Pointer(UInt8), alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a string into an existing memory buffer, pointed to by a Pointer(UInt8), with checksumming. There is assumed to be sufficient space in the buffer to hold the encoded data.


def self.encode(value : String, check : Base58::Check, into : StaticArray(UInt8, _) | Slice(UInt8), alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a string into a buffer composed of either a Slice(UInt8) or a StaticArray(UInt8, _), with checksumming. There is assumed to be sufficient space in the buffer to hold the encoded data.


def self.encode(value : StringBuffer, check : Base58::Check, into = String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a StringBuffer into any target that a String can be encoded into, with checksumming. If no target is specified, it will default to a String.


def self.encode(value : Array(UInt8), check : Base58::Check, into = String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes an Array(UInt8) into any target that a String can be encoded into, with checksumming. If no target is specified, it will default to a String.


def self.encode(value : Array(Char), check : Base58::Check, into = String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes an Array(Char) into any target that a String can be encoded into, with checksumming. If no target is specified, it will default to a String.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), check : Base58::Check, into : String.class = String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into a new String, with checksumming.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), check : Base58::Check, into : StringBuffer.class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into a new StringBuffer, with checksumming.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), check : Base58::Check, into : Pointer.class | Pointer(UInt8).class, alphabet : Alphabet.class = Alphabet::Bitcoin) : Tuple(Pointer(UInt8), Int32) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into a newly allocated memory buffer, with checksumming. The buffer will have sufficient size to hold the encoded data. This method will return a tuple containing the pointer to the data, and its byte size.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), check : Base58::Check, into : Slice(UInt8).class, alphabet : Alphabet.class = Alphabet::Bitcoin) : Slice(UInt8) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into a newly allocated Slice, with checksumming. The Slice will have sufficient size to hold the encoded data.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), check : Base58::Check, into : StaticArray(UInt8, N).class, alphabet : Alphabet.class = Alphabet::Bitcoin) forall N #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into a newly allocated StaticArray, with checksumming. The StaticArray will have sufficient size to hold the encoded data. The method will return a tuple containing the StaticArray and its byte size.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), check : Base58::Check, into : Array(UInt8).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into a newly allocated Array(UInt8), with checksumming.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), check : Base58::Check, into : Array(Char).class, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into a newly allocated Array(Char), with checksumming.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), check : Base58::Check, into : String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into an already existing String, with checksumming. This method actually creates a new String that contains a copy of the contents of the original string, and then concatenates the encoded data to it, and returns the new String.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), check : Base58::Check, into : String, mutate : Bool = false, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into an already existing String. This method defaults to the safe, non-mutating behavior, where the encoded data is concatenated to the original string, and a new String is returned. If you want to mutate the original string, set mutate: true.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), check : Base58::Check, into : StringBuffer, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into an already existing StringBuffer, with checksumming.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), check : Base58::Check, into : Array(UInt8) | Array(Char), alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into an already existing Array(UInt8) or Array(Char), with checksumming. The encoded data is appended to the end of the array, one byte per array element.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), check : Base58::Check, into : Pointer(UInt8), alphabet : Alphabet.class = Alphabet::Bitcoin) : Tuple(Pointer(UInt8), Int32) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into an already existing Pointer(UInt8), with checksumming. The pointer is assumed to reference a section of memory large enough to hold the encoded data. The method returns a tuple containing the pointer and the size of the encoded data.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), check : Base58::Check, into : Slice(UInt8), alphabet : Alphabet.class = Alphabet::Bitcoin) : Slice(UInt8) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into an already existing Slice(UInt8), with checksumming. The Slice is assumed to have sufficient space to hold the encoded data.


def self.encode(value : Slice(UInt8) | StaticArray(UInt8, _), check : Base58::Check, into : StaticArray(UInt8, _), alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into an already existing StaticArray(UInt8, _), with checksumming. The StaticArray is assumed to have sufficient space to hold the encoded data.


def self.encode_to_array(value : Int, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes an Integer to a new Array(UInt8).


def self.encode_to_array(value : Slice(UInt8) | StaticArray(UInt8, _), alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) to a new Array(UInt8).


def self.encode_to_array(value : Slice(UInt8) | StaticArray(UInt8, _), check : Base58::Check, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) to a new Array(UInt8), with checksumming.


def self.encode_to_pointer(value : Pointer(UInt8), size : Int, check : Base58::Check, alphabet : Alphabet.class = Alphabet::Bitcoin) : Tuple(Pointer(UInt8), Int32) #

Encodes the contents of a memory buffer, referenced by a Pointer(UInt8), into a newly allocated memory buffer, with checksumming.


def self.encode_to_pointer(value : Int, alphabet : Alphabet.class = Alphabet::Bitcoin) : Tuple(Pointer(UInt8), Int32) #

Encodes an Integer into a newly allocated memory buffer.


def self.encode_to_pointer(value : Pointer(UInt8), size : Int, alphabet : Alphabet.class = Alphabet::Bitcoin) : Tuple(Pointer(UInt8), Int32) #

Encodes the contents of a memory buffer, referenced by a Pointer(UInt8), into a newly allocated memory buffer.


def self.encode_to_string(value : Pointer(UInt8), size : Int, check : Base58::Check, alphabet : Alphabet.class = Alphabet::Bitcoin) : String #

Encodes the contents of a memory buffer, referenced by a Pointer(UInt8), into a newly allocated String, with checksumming.


def self.encode_to_string(value : Int, alphabet : Alphabet.class = Alphabet::Bitcoin) : String #

Encodes an Integer into a newly allocated String.


def self.encode_to_string(value : Pointer(UInt8), size : Int, alphabet : Alphabet.class = Alphabet::Bitcoin) : String #

Encodes the contents of a memory buffer, referenced by a Pointer(UInt8), into a newly allocated String.


def self.primary_decoding(value : Pointer(UInt8), pointer : Pointer(UInt8), size : Int, index : Int, pointer_index : Int, alphabet : Alphabet.class) #

def self.reverse_decoding(pointer, pointer_index) #

def self.unsafe_decode(value : Pointer(UInt8), size : Int32, into : String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.unsafe_decode(value : Pointer(UInt8), size : Int32, check : Check, into : String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

def self.unsafe_encode(value : Int, into : String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode an integer into an existing String the unsafe way. Crystal strings are immutable, but one can work around that. A String's maximum capacity can not be increased, and the burden here in on the programmer to ensure that the string that is being encoded into has enough capacity for the encoded value.

The encoded value will replace the previous value in the string.

string = (0123456789) * 7
encoded = Base58.encode("encode me, please", string)
puts encoded # => ""xHSYK7uPSx96i9tu3tVH5Ak"

def self.unsafe_encode(value : String, into : String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a string into an existing String by mutating the original string. The original string much have sufficient capacity to hold the encoded data. This is very fast, but the method is labeled unsafe for a reason. It generally works just fine, so long as the string capacity is adequate, but I can't rule out any possibility of surprises.


def self.unsafe_encode(value : Slice(UInt8) | StaticArray(UInt, _), into : String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into an already existing String. This method is unsafe, and will mutate the original string.


def self.unsafe_encode(value : String, check : Base58::Check, into : String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encode a string into an existing String by mutating the original string, with checksumming. The original string much have sufficient capacity to hold the encoded data. This is very fast, but the method is labeled unsafe for a reason. It generally works just fine, so long as the string capacity is adequate, but I can't rule out any possibility of surprises.


def self.unsafe_encode(value : Slice(UInt8) | StaticArray(UInt, _), check : Base58::Check, into : String, alphabet : Alphabet.class = Alphabet::Bitcoin) #

Encodes a Slice(UInt8) or a StaticArray(UInt8, _) into an already existing String, with checksumming. This method is unsafe, and will mutate the original string.


def self.validate_checksum(pointer, pointer_index, check) #

def self.validate_checksum?(pointer, pointer_index, check) #

def self.zero_padding(value : Pointer(UInt8), pointer : Pointer(UInt8), size : Int, pointer_index : Int, zer0 : UInt8) #