JCloudYu/beson · deserialize.esm.js
javascript logo
function __deserializeString(buffer, start, options) {
	let step = 1;
	let dataView = new DataView(buffer);
	let length = dataView.getUint32(start, true);
	start += 4;
	let end = start + length;
	let dataArray = [];
	for (let i = start; i < end; i += step) {
		dataArray.push(dataView.getUint8(i));
	}
	let data = UTF8Decode(Uint8Array.from(dataArray).buffer);
	return { anchor: end, value: data };
}
Similar code snippets
1.
JCloudYu/beson · deserialize.esm.js
Match rating: 79.95% · See similar code snippets
javascript logo
function __deserializeObjectId(buffer, start, options) {
	let step = 1;
	let length = 12;
	let end = start + length;
	let dataView = new DataView(buffer);
	let dataArray = [];
	for (let i = start; i < end; i += step) {
		dataArray.push(dataView.getUint8(i));
	}
	let data = new ObjectId(Uint8Array.from(dataArray).buffer);
	return { anchor: end, value: data };
}
2.
JCloudYu/beson · deserialize.esm.js
Match rating: 74.77% · See similar code snippets
javascript logo
function __deserializeInt64(buffer, start, options) {
	let step = 4;
	let length = 2;
	let end = start + (step * length);
	let dataView = new DataView(buffer);
	let dataArray = [];
	for (let i = start; i < end; i += step) {
		dataArray.push(dataView.getUint32(i, true));
	}
	let data = new Int64(new Uint32Array(dataArray));
	return { anchor: end, value: data };
}
3.
JCloudYu/beson · deserialize.esm.js
Match rating: 70.02% · See similar code snippets
javascript logo
function __deserializeUInt8(buffer, start, options) {
	let end = start + 1;
	let dataView = new DataView(buffer);
	let data = dataView.getUint8(start);
	return { anchor: end, value:options.use_native_types ? data : UInt8.from(data) };
}
4.
JCloudYu/beson · deserialize.esm.js
Match rating: 68.99% · See similar code snippets
javascript logo
function __deserializeInt8(buffer, start, options) {
	let end = start + 1;
	let dataView = new DataView(buffer);
	let data = dataView.getInt8(start);
	return { anchor: end, value:options.use_native_types ? data : Int8.from(data) };
}
5.
JCloudYu/beson · deserialize.esm.js
Match rating: 67.52% · See similar code snippets
javascript logo
function __deserializeDate(buffer, start, options) {
	let end = start + 8;
	let dataView = new DataView(buffer);
	let data = new Date(dataView.getFloat64(start, true));
	return { anchor: end, value: data };
}
6.
JCloudYu/beson · deserialize.esm.js
Match rating: 66.71% · See similar code snippets
javascript logo
function __deserializeUInt32(buffer, start, options) {
	let end = start + 4;
	let dataView = new DataView(buffer);
	let data = dataView.getUint32(start, true);
	return { anchor: end, value:options.use_native_types ? data : UInt32.from(data) };
}
7.
JCloudYu/beson · deserialize.esm.js
Match rating: 66.27% · See similar code snippets
javascript logo
function __deserializeFloat32(buffer, start, options) {
	let end = start + 4;
	let dataView = new DataView(buffer);
	let data = dataView.getFloat32(start, true);
	return { anchor: end, value: data };
}
8.
JCloudYu/beson · deserialize.esm.js
Match rating: 65.89% · See similar code snippets
javascript logo
function __deserializeInt32(buffer, start, options) {
	let end = start + 4;
	let dataView = new DataView(buffer);
	let data = dataView.getInt32(start, true);
	return { anchor: end, value:options.use_native_types ? data : Int32.from(data) };
}
9.
JCloudYu/beson · deserialize.esm.js
Match rating: 62.12% · See similar code snippets
javascript logo
function __deserializeInt16(buffer, start, options) {
	let end = start + 2;
	let dataView = new DataView(buffer);
	let data = dataView.getInt16(start, true);
	return { anchor: end, value:options.use_native_types ? data : Int16.from(data) };
}
10.
RethinkRobotics-opensource/rosnodejs · base_deserialize.js
Match rating: 52.44% · See similar code snippets
javascript logo
function Int8Deserializer(buffer, bufferOffset) {
  let val = buffer.readInt8(bufferOffset[0], true);
  bufferOffset[0] += 1;
  return val;
}