mirror of
https://git.unlock-music.dev/um/um-react.git
synced 2025-05-23 16:27:41 +08:00
10 lines
177 B
TypeScript
10 lines
177 B
TypeScript
export function strlen(data: Uint8Array): number {
|
|
const n = data.byteLength;
|
|
for (let i = 0; i < n; i++) {
|
|
if (data[i] === 0) {
|
|
return i;
|
|
}
|
|
}
|
|
return n;
|
|
}
|