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

Method toString

modules/network/ble/btutils.js:143–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

141 this.set(bytes, true === littleEndian);
142 }
143 toString() {
144 // implementation assumes bytes are in little endian order
145 const byteLength = this.byteLength;
146 if (6 === byteLength)
147 return toHexString(this, ':');
148 if (16 === byteLength) {
149 const bytes = new Uint8Array(this);
150 const string =
151 toHexString(bytes.slice(12, 16)) + '-' +
152 toHexString(bytes.slice(10, 12)) + '-' +
153 toHexString(bytes.slice(8, 10)) + '-' +
154 toHexString(bytes.slice(6, 8)) + '-' +
155 toHexString(bytes.slice(0, 6));
156 return string;
157 }
158
159 return toHexString(this);
160 }
161 set(bytes, littleEndian) @ "xs_bytes_set"
162 equals(bytes) @ "xs_bytes_equals"
163

Callers 6

callbackFunction · 0.45
serverFunction · 0.45
constructorMethod · 0.45
addMethod · 0.45
constructorMethod · 0.45
subscribeMethod · 0.45

Calls 2

toHexStringFunction · 0.85
sliceMethod · 0.65

Tested by

no test coverage detected