Questions tagged [uint8array]

The Uint8Array typed array represents an array of 8-bit unsigned integers.

162 questions
0
votes
1 answer

Convert an array of UInt8 into a String in Swift

I have an array of UInt8 characters that I want to be combined into one cohesive String. I know String has the .utf8 property, and running a for loop over those characters was how I made the UInt8 array, but now I need the reverse of this. For…
TrappinNachos
  • 87
  • 1
  • 7
0
votes
0 answers

Android BLE get raw values from onCharacteristicChanged

Is there a way to get the characteristic.value in onCharacteristicChanged as a byteArray of size 64 in binary? I successfully subscribe to a notify-characteristic of a BLE Service (in Android/Kotlin). I know, that the data sent by the Bluetooth…
Selphiron
  • 897
  • 1
  • 12
  • 30
0
votes
1 answer

javascript: from a websocket I receive messages as zlib deflate: how to read OR "unflate" OR "deflate" (not inflate)

This question is about converting a gzip deflate message from a websocket message and convert it to array OR raw text that I can apply JSON.parse on it... *** to be also clear: In this question : i use a websocket from a crypto exchange.... but the…
John R
  • 277
  • 3
  • 10
0
votes
1 answer

TauriJS writeBinaryFile cannot freeze array buffer views with elements

I work with TauriJS and try to modify a zip file with jszip and later save it with writeBinaryFile. function saveFile(org_path, new_path, pack_format) { var zip = new JSZip(); // get file var org_file = await…
Wolffe2
  • 5
  • 3
0
votes
1 answer

read CAR file using js-car

I have a CAR file object in javascript and want to read it using js-car github. But I keep getting unexpected end of the file error. Here is my code I am trying let arrayBuffer = await files[0].arrayBuffer(); let bytes=new Uint8Array(carFile);…
Majid Hojati
  • 1,740
  • 4
  • 29
  • 61
0
votes
0 answers

Why TextEncoder.encode() produces different result from File.arrayBuffer()?

Here's the simple code: document.querySelector('#upload').addEventListener('change', async (e) => { const initialFile = e.target.files[0]; const arrayBuffer = await initialFile.arrayBuffer(); const text = await initialFile.text(); var enc…
Limon Monte
  • 52,539
  • 45
  • 182
  • 213
0
votes
1 answer

Why this custom implementation slower than the built-in?

May i ask, why this user-made implementations slower than built-in ones: Sample: English (Compulsory) -A BSc 16 101 English 1 -3 Fundamentals of Mathematical Statistics BSc 16 102 Maths 1 -3 Computer Fundamentals and Computing Software BSc 16…
gitman-2021
  • 111
  • 8
0
votes
1 answer

The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array. Received type number - When using Uint8Array.slice()

My code implementation is the following extension of the Uint8Array class. export class ByteArray extends Uint8Array { ... private _encoded: string; ... constructor(_encoded: string) { super(Buffer.from(_encoded,…
ThatAnonyG
  • 137
  • 1
  • 2
  • 9
0
votes
1 answer

Sign a message with EdDSA algorithm in Javascript to get JWT

I need to get JWT with EdDSA algorithm to be able to use an API. I have the private key to sign the message and I could do that with PHP with the next library: https://github.com/firebase/php-jwt (you can see the example with EdDSA at README). Now…
0
votes
1 answer

Taking byte stream (1s & 0s) and storing them in a uint8_t array

I am trying to take this byte stream of information (1's and 0's) and im trying to store this in a uint8_t array (each index would be a byte long, 8 bits). I am having a hard time grasping how to store 8 bits into 1 index location for the given…
0
votes
1 answer

SOLANA sendAndConfirmTransaction and sendTransaction ERROR ( unexpected type, use Uint8Array)

It has been a real big issue finding solution to the error on Solana Transaction API I have sent several messages to the tech discord group and the Telegram group and still did not find any of the Solana tech developers who can solve the issue. I…
Dan George
  • 105
  • 1
  • 2
0
votes
1 answer

decode base64url as uint8array

I'm trying to turn a string of a JWT token signature into a uint8array. lX_aBSgGVYWd2FL6elRHoPJ2nab0IkmmX600cwZPCyK_SazZ-pzBUGDDQ0clthPVAtoS7roHg14xpEJlcSJUZBA7VTlPiDCOrkie_Hmulj765qS44t3kxAYduLhNQ-VN The expected outcome should be the following…
A.C
  • 13
  • 1
  • 8
0
votes
1 answer

how to print a image BluetoothSerial

I'm trying to build ionic print app using BluetoothSerial plugin to print image. I convert (base64) image to Uint8Array before send to printer. but I got nothing. please help me to print image. Uint8Array
SKdlg
  • 1
  • 1
0
votes
0 answers

Typescript make Uint8Array from Number array Number[]

const str = "abc"; let unicodeArray: Number[] = []; let code = 0; for (let i = 0; i < str.length; ++i) { code = str.charCodeAt(i);//returns number unicodeArray = unicodeArray.concat([code]); } //unicodeArray: [97, 98, 99]; let byteArray = new…
Russo
  • 2,186
  • 2
  • 26
  • 42
0
votes
0 answers

How to accept an array of uint8arrays in springboot + kotlin

I want send a post request with a payload that include an array of Uint8Arrays to an API I'm building using kotlin and springboot. The payload being sent up from the typescript client looks like this: interface SavePatternContract { name: string …
Chris Schmitz
  • 20,160
  • 30
  • 81
  • 137