MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / uuid128toBuffer

Function uuid128toBuffer

tools/bles2gatt.js:1746–1752  ·  view source on GitHub ↗
(uuid128)

Source from the content-addressed store, hash-verified

1744}
1745
1746function uuid128toBuffer(uuid128) {
1747 let uuid = uuid128.replace(/-/g,'');
1748 let array = new Uint8Array(16);
1749 for (let i = 0; i < 16; ++i)
1750 array[15 - i] = parseInt(uuid.slice(2 * i, 2 * i + 2), 16);
1751 return array.buffer;
1752}
1753
1754function uuid16toBuffer(uuid16) {
1755 return (new Uint8Array([uuid16 & 0xFF, (uuid16 >> 8) & 0xFF])).buffer;

Callers 6

writeAttributeUUIDMethod · 0.85
generateMethod · 0.85
generateMethod · 0.85
generateMethod · 0.85
writeAttributeUUIDMethod · 0.85

Calls 2

replaceMethod · 0.80
sliceMethod · 0.65

Tested by

no test coverage detected