I need an efficient (read native) way to convert an ArrayBuffer to a base64 string which needs to be used on a multipart post. 15 Answers 15
  • May 19, 2022
  • 0 Comments
UPD TypeScript version is also available in answers Now I’m getting File object by this line: file = document.querySelector('#files > input[type="file"]').files...
  • May 16, 2022
  • 0 Comments
I am trying to “decode” this following Base64 string: OBFZDTcPCxlCKhdXCQ0kMQhKPh9uIgYIAQxALBtZAwUeOzcdcUEeW0dMO1kbPElWCV1ISFFKZ0kdWFlLAURPZhEFQVseXVtPOUUICVhMAzcfZ14AVEdIVVgfAUIBWVpOUlAeaUVMXFlKIy9rGUN0VF08Oz1POxFfTCcVFw1LMQNbBQYWAQ== This is what I know about the string itself: The original string is first passed through the following code:...
  • May 15, 2022
  • 0 Comments
Following this python example, I encode a string as Base64 with: >>> import base64 >>> encoded = base64.b64encode(b'data to be encoded') >>> encoded b'ZGF0YSB0byBiZSBlbmNvZGVk' But, if I leave out...
  • May 15, 2022
  • 0 Comments
In this question Erik needs to generate a secure random token in Node.js. There’s the method crypto.randomBytes that generates a random Buffer. However, the base64 encoding in node is...
  • May 13, 2022
  • 0 Comments