Any SimpleBaseLib example ? lazarus / 21-General ---------------------------------------------------------------------- torbente · 2021-01-09 12:46 I just installed the package SimpleBaseLib, but i can not find an example or manual of this package. Did anyone who ever used this package point me to an example on how to use BaseX conversions? Thanks in advance ---------------------------------------------------------------------- paweld · 2021-01-09 13:14 https://github.com/Xor-el/SimpleBaseLib4Pascal/tree/master/SimpleBaseL ib.Tests/FreePascal.Tests and https://github.com/Xor- el/SimpleBaseLib4Pascal/tree/master/SimpleBaseLib.Tests/src ---------------------------------------------------------------------- torbente · 2021-01-09 19:16 Quote from: paweld on January 09, 2021, 02:14:51 pmhttps://github.com/Xor-el/SimpleBaseLib4Pascal/tree/master/SimpleBas eLib.Tests/FreePascal.Tests and https://github.com/Xor- el/SimpleBaseLib4Pascal/tree/master/SimpleBaseLib.Tests/src I found it but im unable to run the tests, it demands "simplebaselib4pascalpackage" in the project inspector- ---------------------------------------------------------------------- torbente · 2021-01-11 20:55 I actually implemented my own unit to do the basics i needed: - Hex to decimal (example EE5CD7D5D96C8874117891B2C92A036F96918E66C102BC698AE77542C186F981 to number= 10781449753360762705274417785194485859799881330735757732969283 4050226218531201) - Hex to B58 (example 2F88241CB3C2E1FA7A401FE79250090E6F6D8E195354F87B6D92C0124F44C2F9 to base58 = 4CYZopMFQLb7XCvvb6UKtaWFZNRPdi5JZmsaxTN4g3Uk) This are very helpfull for cryptographic operations. ---------------------------------------------------------------------- paweld · 2021-01-12 09:36 Quote from: torbente on January 11, 2021, 09:55:41 pmI actually implemented my own unit to do the basics i needed: ... - Hex to B58 (example 2F88241CB3C2E1FA7A401FE79250090E6F6D8E195354F87B6D92C0124F44C2F9 to base58 = 4CYZopMFQLb7XCvvb6UKtaWFZNRPdi5JZmsaxTN4g3Uk) ... Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses  SbpSimpleBaseLibTypes, SbpBase58; procedure b58encode;var  buffer: TSimpleBaseLibByteArray;  i: Integer;  sIn, sOut: String;begin  sIn := '2F88241CB3C2E1FA7A401FE79250090E6F6D8E195354F87B6D92C0124F44C2F9';  sOut := '';  SetLength(buffer, Length(sIn) div 2);  for i := 0 to Length(buffer) - 1 do    buffer[i] := Hex2Dec(Copy(sIn, (i * 2) + 1, 2));  sOut := TBase58.BitCoin.Encode(buffer);  WriteLn(sOut);end; procedure b58decode;var  buffer: TSimpleBaseLibByteArray;  i: Integer;  sIn, sOut: String;begin  sIn := '';  sOut := '4CYZopMFQLb7XCvvb6UKtaWFZNRPdi5JZmsaxTN4g3Uk';  buffer := TBase58.BitCoin.Decode(sOut);  for i := 0 to Length(buffer) - 1 do    sIn := sIn + inttohex(buffer[i], 2);  WriteLn(sIn);end; ---------------------------------------------------------------------- torbente · 2021-01-12 23:11 I actually created a complete library to manage big integers, necessary for this conversions: doing it manually, like we learned in the school. Since im developing a crypto application, i could need it on the future to reduce dependency from other librarys. Im actually trying to figure out how functions for SHA256 and RIPMED160 to be able to eliminate DCPCrypt from requirements. I dream one day i could create a library to create asymetric keys, sign and verify, etc and do not need OpenSSL  Quote from: paweld on January 12, 2021, 10:36:23 amQuote from: torbente on January 11, 2021, 09:55:41 pmI actually implemented my own unit to do the basics i needed: ... - Hex to B58 (example 2F88241CB3C2E1FA7A401FE79250090E6F6D8E195354F87B6D92C0124F44C2F9 to base58 = 4CYZopMFQLb7XCvvb6UKtaWFZNRPdi5JZmsaxTN4g3Uk) ... Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses  SbpSimpleBaseLibTypes, SbpBase58; procedure b58encode;var  buffer: TSimpleBaseLibByteArray;  i: Integer;  sIn, sOut: String;begin  sIn := '2F88241CB3C2E1FA7A401FE79250090E6F6D8E195354F87B6D92C0124F44C2F9';  sOut := '';  SetLength(buffer, Length(sIn) div 2);  for i := 0 to Length(buffer) - 1 do    buffer[i] := Hex2Dec(Copy(sIn, (i * 2) + 1, 2));  sOut := TBase58.BitCoin.Encode(buffer);  WriteLn(sOut);end; procedure b58decode;var  buffer: TSimpleBaseLibByteArray;  i: Integer;  sIn, sOut: String;begin  sIn := '';  sOut := '4CYZopMFQLb7XCvvb6UKtaWFZNRPdi5JZmsaxTN4g3Uk';  buffer := TBase58.BitCoin.Decode(sOut);  for i := 0 to Length(buffer) - 1 do    sIn := sIn + inttohex(buffer[i], 2);  WriteLn(sIn);end;